mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 13:06:22 +00:00
fix: pass buildId to worker
This commit is contained in:
parent
e89c395f7c
commit
195fc5134c
2 changed files with 8 additions and 2 deletions
|
@ -143,7 +143,7 @@ export async function parseMarkdown(ctx: BuildCtx, fps: FilePath[]): Promise<Pro
|
||||||
|
|
||||||
const childPromises: WorkerPromise<ProcessedContent[]>[] = []
|
const childPromises: WorkerPromise<ProcessedContent[]>[] = []
|
||||||
for (const chunk of chunks(fps, CHUNK_SIZE)) {
|
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) => {
|
const results: ProcessedContent[][] = await WorkerPromise.all(childPromises).catch((err) => {
|
||||||
|
|
|
@ -7,8 +7,14 @@ import { createFileParser, createProcessor } from "./processors/parse"
|
||||||
import { options } from "./util/sourcemap"
|
import { options } from "./util/sourcemap"
|
||||||
|
|
||||||
// only called from worker thread
|
// 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 = {
|
const ctx: BuildCtx = {
|
||||||
|
buildId,
|
||||||
cfg,
|
cfg,
|
||||||
argv,
|
argv,
|
||||||
allSlugs,
|
allSlugs,
|
||||||
|
|
Loading…
Reference in a new issue