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>
12 lines
461 B
Python
12 lines
461 B
Python
"""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"
|