mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-17 14:55:23 +00:00
Fix Format Code Warmings
This commit is contained in:
parent
aa5f5330d3
commit
8a423c0a98
1 changed files with 9 additions and 3 deletions
|
|
@ -43,7 +43,9 @@ async def redis_task_command_listener(app):
|
||||||
try:
|
try:
|
||||||
command = json.loads(message["data"])
|
command = json.loads(message["data"])
|
||||||
except json.JSONDecodeError as json_error:
|
except json.JSONDecodeError as json_error:
|
||||||
log.warning(f"Invalid JSON in Redis message: {message['data'][:100]}... Error: {json_error}")
|
log.warning(
|
||||||
|
f"Invalid JSON in Redis message: {message['data'][:100]}... Error: {json_error}"
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if command.get("action") == "stop":
|
if command.get("action") == "stop":
|
||||||
|
|
@ -58,7 +60,9 @@ async def redis_task_command_listener(app):
|
||||||
log.error(f"Error cancelling task {task_id}: {cancel_error}")
|
log.error(f"Error cancelling task {task_id}: {cancel_error}")
|
||||||
except ExceptionGroup as eg:
|
except ExceptionGroup as eg:
|
||||||
# Handle multiple concurrent exceptions
|
# Handle multiple concurrent exceptions
|
||||||
log.error(f"Multiple errors in task command processing: {len(eg.exceptions)} exceptions")
|
log.error(
|
||||||
|
f"Multiple errors in task command processing: {len(eg.exceptions)} exceptions"
|
||||||
|
)
|
||||||
for i, exc in enumerate(eg.exceptions):
|
for i, exc in enumerate(eg.exceptions):
|
||||||
log.error(f" Exception {i+1}: {type(exc).__name__}: {exc}")
|
log.error(f" Exception {i+1}: {type(exc).__name__}: {exc}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -127,7 +131,9 @@ async def cleanup_task(redis, task_id: str, id=None):
|
||||||
|
|
||||||
# If multiple errors occurred, group them
|
# If multiple errors occurred, group them
|
||||||
if len(cleanup_errors) > 1 and ExceptionGroup:
|
if len(cleanup_errors) > 1 and ExceptionGroup:
|
||||||
raise ExceptionGroup(f"Multiple cleanup errors for task {task_id}", cleanup_errors)
|
raise ExceptionGroup(
|
||||||
|
f"Multiple cleanup errors for task {task_id}", cleanup_errors
|
||||||
|
)
|
||||||
elif cleanup_errors:
|
elif cleanup_errors:
|
||||||
raise cleanup_errors[0]
|
raise cleanup_errors[0]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue