From 195fc5134c41ea75161cab9af9ef135074754db5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 8 Aug 2024 19:33:27 -0700 Subject: [PATCH] fix: pass buildId to worker --- quartz/processors/parse.ts | 2 +- quartz/worker.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/quartz/processors/parse.ts b/quartz/processors/parse.ts index 3950fee09..2bd530c64 100644 --- a/quartz/processors/parse.ts +++ b/quartz/processors/parse.ts @@ -143,7 +143,7 @@ export async function parseMarkdown(ctx: BuildCtx, fps: FilePath[]): Promise[] = [] for (const chunk of chunks(fps, CHUNK_SIZE)) { - childPromises.push(pool.exec("parseFiles", [argv, chunk, ctx.allSlugs])) + childPromises.push(pool.exec("parseFiles", [ctx.buildId, argv, chunk, ctx.allSlugs])) } const results: ProcessedContent[][] = await WorkerPromise.all(childPromises).catch((err) => { diff --git a/quartz/worker.ts b/quartz/worker.ts index b92bdac94..a209df9a0 100644 --- a/quartz/worker.ts +++ b/quartz/worker.ts @@ -7,8 +7,14 @@ import { createFileParser, createProcessor } from "./processors/parse" import { options } from "./util/sourcemap" // only called from worker thread -export async function parseFiles(argv: Argv, fps: FilePath[], allSlugs: FullSlug[]) { +export async function parseFiles( + buildId: string, + argv: Argv, + fps: FilePath[], + allSlugs: FullSlug[], +) { const ctx: BuildCtx = { + buildId, cfg, argv, allSlugs,