fix(cost): use new_event_loop pattern for Whisper cost tracking (matches ingest_and_ai.py)
This commit is contained in:
parent
922cb9318e
commit
07d2112e53
1 changed files with 5 additions and 1 deletions
|
|
@ -212,7 +212,11 @@ def transcribe_video_audio_task(self, job_id: str, audio_path: str) -> dict:
|
|||
finally:
|
||||
client.close()
|
||||
|
||||
job_doc = asyncio.run(_fetch_job())
|
||||
loop = asyncio.new_event_loop()
|
||||
try:
|
||||
job_doc = loop.run_until_complete(_fetch_job())
|
||||
finally:
|
||||
loop.close()
|
||||
user_id = str(job_doc.get("created_by", "")) if job_doc else ""
|
||||
project_id = str(job_doc.get("cost_tracker_project_id", "")) if job_doc else ""
|
||||
cost_tracker.record(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue