Prevent Morse start timeout aborts on slow startup

This commit is contained in:
Smittix
2026-02-26 12:39:31 +00:00
parent 99db7f1faf
commit a50d200af4
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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 = ''
+6 -1
View File
@@ -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);
});