trace: check if DBPools blocks in background task

This commit is contained in:
yumoqing 2026-07-31 18:56:51 +08:00
parent 2f7acc8120
commit 5bf3ef3822

View File

@ -29,12 +29,12 @@ ext_l = ext.lower()
# creates its own DBPools connection. All args are primitives. # creates its own DBPools connection. All args are primitives.
# ============================================================ # ============================================================
async def ingest_doc(doc_id, kb_id, file_name, ext_l, real_path): async def ingest_doc(doc_id, kb_id, file_name, ext_l, real_path):
# DEBUG: verify background_reco executes
try:
with open('/tmp/_bg_trace_' + doc_id + '.txt', 'w') as df:
df.write('ingest_doc started\n')
except: pass
db = DBPools() db = DBPools()
# TRACE
try:
with open('/tmp/_t2_' + doc_id, 'w') as df:
df.write('db ok, reading file: ' + real_path)
except: pass
text = '' text = ''
chunks_n = 0 chunks_n = 0
face_count = 0 face_count = 0