fix(capture): reduce pre-roll to 1s in standby mode (slot already warm)

This commit is contained in:
Wild Dragon Dev 2026-06-03 22:05:11 +00:00
parent ef57900583
commit 3d4880d944

View file

@ -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