From c14d8b66e58b6827228074ffe7ffa42834bd7408 Mon Sep 17 00:00:00 2001 From: Joan Cabezas Date: Fri, 4 Oct 2024 21:17:07 -0700 Subject: [PATCH] memory_creation_timeout variable --- backend/routers/transcribe_v2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/routers/transcribe_v2.py b/backend/routers/transcribe_v2.py index 984ef35de..6b4a04b3c 100644 --- a/backend/routers/transcribe_v2.py +++ b/backend/routers/transcribe_v2.py @@ -84,6 +84,7 @@ async def _websocket_util( # Soft timeout, should < MODAL_TIME_OUT - 3m timeout_seconds = 420 # 7m started_at = time.time() + memory_creation_timeout = 15 def _get_in_progress_memory(segments: List[dict]): @@ -99,7 +100,7 @@ def _get_in_progress_memory(segments: List[dict]): existing = memories_db.get_in_progress_memory(uid) if existing: - if time.time() - existing['finished_at'].timestamp() > 120: + if time.time() - existing['finished_at'].timestamp() > memory_creation_timeout: memories_db.update_memory_status(uid, existing['id'], MemoryStatus.failed) existing = None @@ -140,7 +141,7 @@ def _get_in_progress_memory(segments: List[dict]): async def memory_creation_timer(): try: - await asyncio.sleep(15) + await asyncio.sleep(memory_creation_timeout) await _create_memory() except asyncio.CancelledError: pass