server restart stuck fixes

This commit is contained in:
legop3
2026-06-10 13:16:57 -04:00
parent 5770dc8849
commit 8d90a29345
5 changed files with 64 additions and 13 deletions
@@ -31,15 +31,13 @@ function registerAudioForwardHooks(deps) {
stopWorker(roverId);
return;
}
if (action === 'upsert' && serviceEnabled) {
if (whipOwners.has(roverId)) {
return;
}
try {
ensureWorker(roverId);
} catch (err) {
setState(roverId, { state: 'error', source: 'init', error: err.message, startedAt: null });
}
if (action === 'upsert' && serviceEnabled && !workers.has(roverId)) {
// A rover coming online should not create ffmpeg publishers by itself.
// The audio worker is intentionally lazy because uploads, mic forwarding,
// and automatic sounds are the moments that actually need a media pipe;
// keeping idle ffmpeg children around made restarts depend on processes
// that may never have been used by an operator.
setState(roverId, { state: 'offline', source: 'none', error: null, startedAt: null });
}
});