feat(cron): make the media-send timeout configurable
The media delivery path used a hardcoded future.result(timeout=30). Large attachments legitimately exceed it with no way to raise the limit. Read HERMES_CRON_MEDIA_SEND_TIMEOUT, matching the existing HERMES_CRON_SCRIPT_TIMEOUT / HERMES_CRON_TIMEOUT / HERMES_CRON_SESSION_DB_TIMEOUT convention in the same module.
This commit is contained in:
committed by
Teknium
parent
64b7c96e45
commit
d9ec9dd3fd
@@ -2402,7 +2402,12 @@ def _send_media_via_adapter(
|
||||
errors.append(msg)
|
||||
return errors
|
||||
try:
|
||||
result = future.result(timeout=30)
|
||||
# Large attachments (long TTS audio, concatenated recordings,
|
||||
# big exports) can legitimately exceed a fixed 30s upload
|
||||
# window. Configurable, matching the other cron timeouts.
|
||||
result = future.result(
|
||||
timeout=int(os.getenv("HERMES_CRON_MEDIA_SEND_TIMEOUT", "300"))
|
||||
)
|
||||
except TimeoutError:
|
||||
future.cancel()
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user