chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-04-24 18:48:21 +09:00
parent f48b8ffbf0
commit 8ff7ff459b
18 changed files with 73 additions and 88 deletions
+3 -1
View File
@@ -1869,6 +1869,7 @@ async def chat_completion(
except asyncio.CancelledError:
log.info('Chat processing was cancelled')
try:
async def emit_cancel_event():
event_emitter = await get_event_emitter(metadata)
if event_emitter:
@@ -1940,6 +1941,7 @@ async def chat_completion(
try:
if metadata.get('chat_id'):
async def emit_inactive_event():
try:
event_emitter = await get_event_emitter(metadata, update_db=False)
@@ -1947,7 +1949,7 @@ async def chat_completion(
await event_emitter({'type': 'chat:active', 'data': {'active': False}})
except Exception:
pass
try:
# Shield the event emission so it finishes even if the main task is cancelled
await asyncio.shield(emit_inactive_event())