increase the stt inactivity timeout threshold due to the instability of audio bytes on some 3rd devices#3659
Conversation
…of audio bytes on some 3rd devices
There was a problem hiding this comment.
Code Review
This pull request increases the STT inactivity timeout from 30 to 90 seconds to handle audio instability from some third-party devices. While the change is reasonable, I've suggested making this timeout value configurable through an environment variable. This will improve maintainability by allowing future adjustments without code changes, which is a common pattern in this codebase.
| # Heart beat | ||
| started_at = time.time() | ||
| inactivity_timeout_seconds = 30 | ||
| inactivity_timeout_seconds = 90 |
There was a problem hiding this comment.
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).
| inactivity_timeout_seconds = 90 | |
| inactivity_timeout_seconds = int(os.getenv("STT_INACTIVITY_TIMEOUT_SECONDS", 90)) |
…of audio bytes on some 3rd devices (BasedHardware#3659)
No description provided.