From d9ec9dd3fdbdfcc41a97d360b2e8d370f5f3e261 Mon Sep 17 00:00:00 2001 From: AiwendilInTheWoods <2050361+AiwendilInTheWoods@users.noreply.github.com> Date: Sun, 16 Aug 2026 17:19:25 -0500 Subject: [PATCH] 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. --- cron/scheduler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cron/scheduler.py b/cron/scheduler.py index 0a4143247a..1cbb68c1e1 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -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