fix: Docker volume path, graceful shutdown deadline, inline stream headers

docker-compose.yml: mount ./recordings at /app/recordings (matches
output_directory = recordings in config.ini); previously the recorder
wrote to /app/recordings while the web container read from /recordings,
causing all files to appear missing — explaining the 9-byte Not-found
download from /stream/ and the 0-byte recordings in the UI.
Add stop_grace_period: 30s so Docker waits long enough for files to close.

isr.py: replace per-thread join(timeout=5) with a shared 25 s deadline;
with N recorders the old code could exceed Docker's SIGKILL window and
leave WAV/FLAC files unclosed (corrupt headers).

web.py: add Content-Disposition: inline to /stream/ responses so
browsers never treat the audio response as a file download.

CLAUDE.md: document web.py endpoints, status.json lifecycle, corrected
Docker volume layout, and web.py CLI flags.
This commit is contained in:
2026-04-26 13:10:14 +02:00
parent 624f1f2664
commit da67523170
4 changed files with 26 additions and 7 deletions
+5 -1
View File
@@ -946,8 +946,12 @@ class RecorderManager:
for recorder in self.recorders:
recorder.stop()
# Use a shared deadline so N recorders don't each burn 5 s sequentially,
# which would exceed Docker's stop_grace_period for more than 2 recorders.
deadline = time.time() + 25
for thread in self.threads:
thread.join(timeout=5)
remaining = max(0.1, deadline - time.time())
thread.join(timeout=remaining)
# Clear status file so the web UI shows no active recordings
try: