chore: MEDIA_DEBUG_STDERR=1 routes produce ffmpeg stderr to /tmp/ffmpeg-debug.log (debug aid; default stays redacted)
This commit is contained in:
parent
87ddc1a206
commit
d95cee8878
1 changed files with 10 additions and 2 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
* Everything else is env parity with the API's storage (S3_ENDPOINT/S3_ACCESS_KEY/
|
* Everything else is env parity with the API's storage (S3_ENDPOINT/S3_ACCESS_KEY/
|
||||||
* S3_SECRET_KEY/S3_BUCKET/S3_KEK) and DATABASE_URL for the job tables.
|
* S3_SECRET_KEY/S3_BUCKET/S3_KEK) and DATABASE_URL for the job tables.
|
||||||
*/
|
*/
|
||||||
import { mkdirSync } from "node:fs";
|
import { appendFileSync, mkdirSync } from "node:fs";
|
||||||
import pino from "pino";
|
import pino from "pino";
|
||||||
import { Pool as PgPool } from "pg";
|
import { Pool as PgPool } from "pg";
|
||||||
import { laneFromEnv, resolveProduceFont } from "./env";
|
import { laneFromEnv, resolveProduceFont } from "./env";
|
||||||
|
|
@ -34,7 +34,15 @@ export async function startProduceWorker(): Promise<{ runner: ProduceRunner; poo
|
||||||
fontFile,
|
fontFile,
|
||||||
scratchRoot,
|
scratchRoot,
|
||||||
lane,
|
lane,
|
||||||
redactor: { redact: () => "[produce stderr redacted]" },
|
redactor: {
|
||||||
|
redact: (line) => {
|
||||||
|
if (process.env.MEDIA_DEBUG_STDERR === "1") {
|
||||||
|
appendFileSync("/tmp/ffmpeg-debug.log", line + "\n");
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
return "[produce stderr redacted]";
|
||||||
|
},
|
||||||
|
},
|
||||||
onStderr: (message) => logger.warn({ message }, "ffmpeg stderr"),
|
onStderr: (message) => logger.warn({ message }, "ffmpeg stderr"),
|
||||||
onEvent: (event) => {
|
onEvent: (event) => {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue