Detect a dead local pipeline worker after API restart, and flush SSE.

A docker rebuild left HubAudio status=running with no process, so the UI sat on a silent event stream. Persist the worker pid and disable proxy buffering on the SSE response.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-28 08:50:33 +02:00
co-authored by Cursor
parent ea43b550ee
commit 96e2590a3c
3 changed files with 63 additions and 12 deletions
+11
View File
@@ -0,0 +1,11 @@
"""Local worker pid file so a restarted API can see a dead subprocess."""
from backend.services import job_runner
def test_local_state_failed_when_pid_file_is_stale(tmp_path, monkeypatch):
monkeypatch.setattr(job_runner.settings, "data_dir", tmp_path)
pid_path = tmp_path / "workers" / "proj.pid"
pid_path.parent.mkdir(parents=True)
pid_path.write_text("99999999")
assert job_runner.get_execution_state("local/projects/proj") == "failed"