Fix ragflow server hung after parsing a big file (#17936)

This commit is contained in:
Wang Qi
2026-08-06 17:01:53 +08:00
committed by GitHub
parent 8379165c12
commit 23b20a098a
2 changed files with 20 additions and 7 deletions

View File

@@ -58,17 +58,19 @@ def update_progress():
redis_lock = RedisDistributedLock("update_progress", lock_value=lock_value, timeout=60)
logging.info(f"update_progress lock_value: {lock_value}")
while not stop_event.is_set():
acquired = False
try:
if redis_lock.acquire():
acquired = redis_lock.acquire()
if acquired:
DocumentService.update_progress()
redis_lock.release()
except Exception:
logging.exception("update_progress exception")
finally:
try:
redis_lock.release()
except Exception:
logging.exception("update_progress exception")
if acquired:
try:
redis_lock.release()
except Exception:
logging.exception("update_progress exception")
stop_event.wait(6)