diff --git a/services/capture/src/capture-manager.js b/services/capture/src/capture-manager.js index e0d3cd4..39f9d87 100644 --- a/services/capture/src/capture-manager.js +++ b/services/capture/src/capture-manager.js @@ -7,7 +7,11 @@ import { createUploadStream } from './s3/client.js'; const S3_BUCKET = process.env.S3_BUCKET || 'wild-dragon'; -const PRE_ROLL_SECONDS = parseInt(process.env.PRE_ROLL_SECONDS || '5', 10); +// In standby mode the framecache slot has been warm for a long time — reduce +// pre-roll to 1s (just enough for fc_pipe to sync its read cursor). +// Override with PRE_ROLL_SECONDS env var if needed. +const _standbyMode = process.env.STANDBY === '1'; +const PRE_ROLL_SECONDS = parseInt(process.env.PRE_ROLL_SECONDS || (_standbyMode ? '1' : '5'), 10); // Growing-files mode: writes the master to a local SMB-backed share that the