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:
@@ -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"
|
||||
Reference in New Issue
Block a user