Skip to content

Commit

Permalink
test: add add'l try/catch logging
Browse files Browse the repository at this point in the history
  • Loading branch information
btlghrants committed Jan 6, 2025
1 parent cd03899 commit 54d97b9
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions hack/load.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,15 @@ program
.concat("\n");
await fs.appendFile(audFile, outlines);
};
audience(); // run immediately, then on schedule
const ticket = setInterval(audience, opts.audInterval);
await audience(); // run immediately, then on schedule
const ticket = setInterval(async () => {
try {
await audience();
} catch (e) {
console.error(e);
process.exit(1);
}
}, opts.audInterval);

await nap(opts.stagger); // stagger interval starts

Expand All @@ -763,9 +770,15 @@ program
await fs.appendFile(actFile, Date.now().toString() + "\n");
}
};
actress(); // run immediately, then on schedule
const backstagePass = setInterval(() => actress(abort), opts.actInterval);

await actress(); // run immediately, then on schedule
const backstagePass = setInterval(async () => {
try {
await actress(abort);
} catch (e) {
console.error(e);
process.exit(1);
}
}, opts.actInterval);
// wait until total duration has elapsed
const startWait = Date.now();
await nap(opts.duration - (startWait - alpha));
Expand Down

0 comments on commit 54d97b9

Please sign in to comment.