fix: cancel된 job도 DB에 상태 기록
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,11 @@ async def run(job: Job) -> None:
|
||||
if job.status == JobStatus.cancelled:
|
||||
logger.info("Job %s cancelled during streaming", job.id)
|
||||
await state_stream.push(job.id, "error", {"message": "작업이 취소되었습니다."})
|
||||
latency_ms = (time() - start_time) * 1000
|
||||
try:
|
||||
await log_completion(job.id, "cancelled", len("".join(collected)), latency_ms, time())
|
||||
except Exception:
|
||||
pass
|
||||
return
|
||||
|
||||
collected.append(chunk)
|
||||
|
||||
Reference in New Issue
Block a user