mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-09 22:33:29 +00:00
fix: prevent transient errors from permanently killing cleanup loops
This commit is contained in:
parent
2ca7c3bfe6
commit
daf107a993
1 changed files with 8 additions and 2 deletions
|
|
@ -186,10 +186,16 @@ async def run_with_lock(acquire_fn, renew_fn, release_fn, work_fn, interval, loc
|
|||
if not renew_fn():
|
||||
log.info('Lock renewal failed. Will re-acquire.')
|
||||
break
|
||||
await work_fn()
|
||||
try:
|
||||
await work_fn()
|
||||
except Exception:
|
||||
log.exception('Periodic work_fn failed; will retry next cycle')
|
||||
await asyncio.sleep(interval)
|
||||
finally:
|
||||
release_fn()
|
||||
try:
|
||||
release_fn()
|
||||
except Exception:
|
||||
log.exception('Failed to release lock')
|
||||
|
||||
|
||||
async def periodic_session_pool_cleanup():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue