diff --git a/services/capture/src/capture-manager.js b/services/capture/src/capture-manager.js index 89baa72..1f022a7 100644 --- a/services/capture/src/capture-manager.js +++ b/services/capture/src/capture-manager.js @@ -17,9 +17,9 @@ const PRE_ROLL_SECONDS = parseInt(process.env.PRE_ROLL_SECONDS || (_standbyMode // Growing-files mode: writes the master to a local SMB-backed share that the // editor can mount, instead of streaming to S3 in real time. The promotion // worker uploads the finalized file to S3 after the recording stops. -// Toggled per-recorder via `GROWING_ENABLED=true` on the capture container -// (see routes/recorders.js where the env is composed). -const GROWING_ENABLED = process.env.GROWING_ENABLED === 'true'; +// Toggled per-recorder via `GROWING_ENABLED=true`, delivered per-session on +// /capture/start (read fresh from process.env at record time in start(), NOT +// cached here — standby sidecars boot with it false). const GROWING_PATH = process.env.GROWING_PATH || '/growing'; // Approach A: when a CIFS source is supplied, this (privileged) container mounts @@ -1001,8 +1001,14 @@ exit "$BMXRC" // Approach A: if a CIFS source is configured, mount it now. A mount failure // is non-fatal — we fall back to S3 streaming so the recording is never // lost. - let growingActive = GROWING_ENABLED; - if (growingActive && GROWING_SMB_MOUNT) { + // Read growing flags FRESH from env at record time — standby sidecars boot + // with GROWING_ENABLED=false and receive the real value per-session over + // /capture/start (capture.js sets process.env before this runs). The old + // module-level `const GROWING_ENABLED` / `GROWING_SMB_MOUNT` captured the + // empty boot values, so growing never engaged and every "growing" record + // silently produced HEVC/S3 instead of the XDCAM HD422 MXF. + let growingActive = process.env.GROWING_ENABLED === 'true'; + if (growingActive && growingSmbConfig().mount) { if (!mountGrowingShare()) growingActive = false; // fall back to S3 } // Growing master is always MXF OP1a / XDCAM HD422 written by raw2bmx (the