Selaa lähdekoodia
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 kuukautta sitten
vanhempi
commit
c88e4b3fc0
No account linked to committer's email address
|
|
|
@@ -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(): |