hotfix: make colors/icons non-blocking and add decompile_gzip timeout to fix 6h hang
This commit is contained in:
parent
839cf1f2cf
commit
0f7170e1c7
1 changed files with 22 additions and 8 deletions
|
|
@ -87,16 +87,30 @@ export async function runTasks() {
|
||||||
|
|
||||||
const code = (await Bun.file(codePath).text()).replace(/\r/g, "").split("\n");
|
const code = (await Bun.file(codePath).text()).replace(/\r/g, "").split("\n");
|
||||||
|
|
||||||
await Promise.allSettled([
|
await wrapPromise(codeTask(progress, code), progress, "code");
|
||||||
wrapPromise(codeTask(progress, code), progress, "code"),
|
if (progress.someFailed("code"))
|
||||||
wrapPromise(colorsTask(code), progress, "colors"),
|
throw new Error(`Failed at parser tasks!\n${progress.prettyErrors("code")}`);
|
||||||
wrapPromise(iconsTask(progress, code), progress, "icons"),
|
// colors is non-critical, run in background
|
||||||
]);
|
wrapPromise(colorsTask(code), progress, "colors").catch((e) => {
|
||||||
if (progress.someFailed("code", "colors", "icons"))
|
progress.update("colors", false, String(e));
|
||||||
throw new Error(`Failed at parser tasks!\n${progress.prettyErrors("code", "colors", "icons")}`);
|
console.warn("Colors task failed (non-critical):", e);
|
||||||
|
});
|
||||||
|
// icons disabled for now (6h hang due to parseAssets), will be fixed separately
|
||||||
|
// wrapPromise(iconsTask(progress, code), progress, "icons").catch((e) => {
|
||||||
|
// progress.update("icons", false, String(e));
|
||||||
|
// console.warn("Icons task failed (non-critical):", e);
|
||||||
|
// });
|
||||||
|
progress.update("icons", null);
|
||||||
|
progress.update("diff_icons", null);
|
||||||
|
|
||||||
while (!progress.isFinished("decompile_gzip")) {
|
let waits = 0;
|
||||||
|
while (!progress.isFinished("decompile_gzip") && waits < 120) {
|
||||||
await Bun.sleep(1000);
|
await Bun.sleep(1000);
|
||||||
|
waits++;
|
||||||
|
}
|
||||||
|
if (!progress.isFinished("decompile_gzip")) {
|
||||||
|
console.warn("decompile_gzip still not finished after 120s, continuing anyway");
|
||||||
|
progress.update("decompile_gzip", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (progress.someFailed("decompile_gzip"))
|
if (progress.someFailed("decompile_gzip"))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue