mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-09 00:47:59 +08:00
Fix ragflow server hung after parsing a big file (#17936)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user