Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/routers/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _send_message_event(msg: MessageEvent):

# Heart beat
started_at = time.time()
inactivity_timeout_seconds = 30
inactivity_timeout_seconds = 90
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The inactivity timeout is hardcoded. It's better to make this value configurable via an environment variable. This allows for easier adjustments in different environments (development, staging, production) or for future tuning without requiring a code change and redeployment. This is consistent with how other timeouts and configuration values are handled in the codebase (e.g., in backend/utils/other/timeout.py).

Suggested change
inactivity_timeout_seconds = 90
inactivity_timeout_seconds = int(os.getenv("STT_INACTIVITY_TIMEOUT_SECONDS", 90))

last_audio_received_time = None

# Send pong every 10s then handle it in the app \
Expand Down