refs #4550 Promise.all() catch fix
gitea/printnatura/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-12-23 21:28:02 +01:00
parent 53ff37d66c
commit 22515cabb9
1 changed files with 7 additions and 2 deletions

View File

@ -124,8 +124,13 @@ class PrintServer {
jobs = [];
for (let i = 0; i < conf.concurrency; i++) {
const jobId = await this.getJob();
if (jobId)
jobs.push(this.printJob(jobId));
if (jobId) {
const job = this.printJob(jobId);
// XXX: Workaround for Promise.all() unhandledRejection
// https://stackoverflow.com/questions/67789309/why-do-i-get-an-unhandled-promise-rejection-with-await-promise-all
job.catch(() => {});
jobs.push(job);
}
else
break;
}