mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 10:55:17 +00:00
Add timeout to asyncio.wait
This commit is contained in:
parent
943fe57231
commit
e7317ce99f
1 changed files with 3 additions and 1 deletions
|
|
@ -86,7 +86,9 @@ def run(inargs=None, args=None):
|
||||||
if get_settings().litellm.get("enable_callbacks", False):
|
if get_settings().litellm.get("enable_callbacks", False):
|
||||||
# There may be additional events on the event queue from the run above. If there are give them time to complete.
|
# There may be additional events on the event queue from the run above. If there are give them time to complete.
|
||||||
get_logger().debug("Waiting for event queue to complete")
|
get_logger().debug("Waiting for event queue to complete")
|
||||||
await asyncio.wait([task for task in asyncio.all_tasks() if task is not asyncio.current_task()])
|
tasks = [task for task in asyncio.all_tasks() if task is not asyncio.current_task()]
|
||||||
|
if tasks:
|
||||||
|
await asyncio.wait(tasks, timeout=30)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue