diff --git a/routes/morse.py b/routes/morse.py index bfc9761..6b01b7f 100644 --- a/routes/morse.py +++ b/routes/morse.py @@ -436,7 +436,7 @@ def start_morse() -> Response: ) decoder_thread.start() - startup_deadline = time.monotonic() + 2.5 + startup_deadline = time.monotonic() + 2.0 startup_ok = False startup_error = '' diff --git a/static/js/modes/morse.js b/static/js/modes/morse.js index dddcc55..ef23a66 100644 --- a/static/js/modes/morse.js +++ b/static/js/modes/morse.js @@ -8,7 +8,7 @@ var MorseMode = (function () { var SETTINGS_KEY = 'intercept.morse.settings.v3'; var STATUS_POLL_MS = 5000; var LOCAL_STOP_TIMEOUT_MS = 2200; - var START_TIMEOUT_MS = 10000; + var START_TIMEOUT_MS = 20000; var state = { initialized: false, @@ -85,6 +85,11 @@ var MorseMode = (function () { } return data; }); + }).catch(function (err) { + if (err && err.name === 'AbortError') { + throw new Error('Request timed out while waiting for decoder startup'); + } + throw err; }).finally(function () { if (timeoutId) clearTimeout(timeoutId); });