瀏覽代碼

Fix: improve recover_pending_tasks timeout (#7408)

### What problem does this PR solve?

Fix the redis lock will always timeout (change the logic order release
lock first)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.19.0
Stephen Hu 6 月之前
父節點
當前提交
c88e4b3fc0
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. 3
    2
      rag/svr/task_executor.py

+ 3
- 2
rag/svr/task_executor.py 查看文件

@@ -700,12 +700,13 @@ def recover_pending_tasks():
f"time since delivered: {msg['time_since_delivered'] / 1000} s"
)
REDIS_CONN.requeue_msg(queue_name, SVR_CONSUMER_GROUP_NAME, msg['message_id'])

stop_event.wait(60)
except Exception:
logging.warning("recover_pending_tasks got exception")
finally:
redis_lock.release()
stop_event.wait(60)



async def main():

Loading…
取消
儲存