Ver código fonte

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 meses atrás
pai
commit
c88e4b3fc0
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3
    2
      rag/svr/task_executor.py

+ 3
- 2
rag/svr/task_executor.py Ver arquivo

@@ -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():

Carregando…
Cancelar
Salvar