mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 11:36:20 +00:00
scrap: trackear proceso zstd
This commit is contained in:
parent
eb0e62447b
commit
8482d7ceea
1 changed files with 6 additions and 3 deletions
|
@ -37,9 +37,8 @@ export async function parseWarc(path: string) {
|
||||||
errors: { error: any; warcRecordId: string; path: string }[];
|
errors: { error: any; warcRecordId: string; path: string }[];
|
||||||
} = { done: 0, errors: [] };
|
} = { done: 0, errors: [] };
|
||||||
|
|
||||||
const warc = Bun.spawn(["zstd", "-do", "/dev/stdout", path], {
|
const proc = Bun.spawn(["zstdcat", "-d", path], {});
|
||||||
stderr: "ignore",
|
const warc = proc.stdout;
|
||||||
}).stdout;
|
|
||||||
// TODO: tirar error si falla zstd
|
// TODO: tirar error si falla zstd
|
||||||
|
|
||||||
const parser = new WARCParser(warc);
|
const parser = new WARCParser(warc);
|
||||||
|
@ -99,5 +98,9 @@ export async function parseWarc(path: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((await proc.exited) !== 0) {
|
||||||
|
throw new Error("zstd tiró un error");
|
||||||
|
}
|
||||||
|
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue