Skip to content

Commit

Permalink
memory_creation_timeout variable
Browse files Browse the repository at this point in the history
  • Loading branch information
josancamon19 committed Oct 5, 2024
1 parent 765b6da commit c14d8b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/routers/transcribe_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c14d8b6

Please sign in to comment.