Fix Code Format Warmings

This commit is contained in:
_00_ 2025-08-19 20:13:55 +02:00 committed by GitHub
parent 8a423c0a98
commit 5fdb68bd27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -578,17 +578,19 @@ async def lifespan(app: FastAPI):
yield
# In the lifespan shutdown
if hasattr(app.state, "redis_task_command_listener"):
try:
app.state.redis_task_command_listener.cancel()
await app.state.redis_task_command_listener
except ExceptionGroup as eg:
log.error(f"Multiple errors during listener shutdown: {len(eg.exceptions)} exceptions")
for exc in eg.exceptions:
log.error(f"Shutdown error: {type(exc).__name__}: {exc}")
except asyncio.CancelledError:
pass # Expected during shutdown
# In the lifespan shutdown
if hasattr(app.state, "redis_task_command_listener"):
try:
app.state.redis_task_command_listener.cancel()
await app.state.redis_task_command_listener
except ExceptionGroup as eg:
log.error(
f"Multiple errors during listener shutdown: {len(eg.exceptions)} exceptions"
)
for exc in eg.exceptions:
log.error(f"Shutdown error: {type(exc).__name__}: {exc}")
except asyncio.CancelledError:
pass # Expected during shutdown
except Exception as e:
log.error(f"Error during listener shutdown: {e}")