fix: produce worker boot — scratch dir bootstrap + api ffprobe
The produce worker crashed its claim cycle at the scratch mkdtemp (ENOENT: the parent dir never existed on a fresh volume) — bootstrap MEDIA_SCRATCH_DIR recursively at startup. The api image lacked ffprobe entirely, so every upload's probe job failed — install ffmpeg in the api runtime image.
This commit is contained in:
parent
40e0c49f7c
commit
26f3a27eee
1 changed files with 4 additions and 1 deletions
|
|
@ -12,6 +12,7 @@
|
|||
* 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.
|
||||
*/
|
||||
import { mkdirSync } from "node:fs";
|
||||
import pino from "pino";
|
||||
import { Pool as PgPool } from "pg";
|
||||
import { laneFromEnv, resolveProduceFont } from "./env";
|
||||
|
|
@ -24,12 +25,14 @@ const logger = pino({ level: process.env.LOG_LEVEL ?? "info" });
|
|||
export async function startProduceWorker(): Promise<{ runner: ProduceRunner; pool: PgPool }> {
|
||||
const lane = laneFromEnv(process.env.MEDIA_WORKER_LANE);
|
||||
const fontFile = resolveProduceFont(process.env.MEDIA_PRODUCE_FONT);
|
||||
const scratchRoot = process.env.MEDIA_SCRATCH_DIR ?? "/var/tmp/media-worker/produce";
|
||||
mkdirSync(scratchRoot, { recursive: true });
|
||||
const pool = new PgPool({ connectionString: process.env.DATABASE_URL });
|
||||
const runner = new ProduceRunner({
|
||||
jobs: new PostgresProduceJobStore(pool),
|
||||
storage: new WorkerS3Storage(workerStorageConfigFromEnv()),
|
||||
fontFile,
|
||||
scratchRoot: process.env.MEDIA_SCRATCH_DIR ?? "/var/tmp/media-worker/produce",
|
||||
scratchRoot,
|
||||
lane,
|
||||
redactor: { redact: () => "[produce stderr redacted]" },
|
||||
onStderr: (message) => logger.warn({ message }, "ffmpeg stderr"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue