mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: Implicit asyncio create_task
This commit is contained in:
parent
5b9c1de3d1
commit
cf2d7de873
@ -366,21 +366,17 @@ async def chat_web_search_handler(
|
||||
}
|
||||
)
|
||||
|
||||
web_search_tasks = [
|
||||
asyncio.create_task(
|
||||
gathered_results = await asyncio.gather(
|
||||
*(
|
||||
process_web_search(
|
||||
request,
|
||||
SearchForm(
|
||||
**{
|
||||
"query": searchQuery,
|
||||
}
|
||||
),
|
||||
SearchForm(**{"query": searchQuery}),
|
||||
user=user,
|
||||
)
|
||||
)
|
||||
for searchQuery in queries
|
||||
]
|
||||
gathered_results = await asyncio.gather(*web_search_tasks, return_exceptions=True)
|
||||
for searchQuery in queries
|
||||
),
|
||||
return_exceptions=True,
|
||||
)
|
||||
|
||||
for searchQuery, results in zip(queries, gathered_results):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user