You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When launching bree with express, re-call bree.start() throws an exception for already started jobs and node app crashed.
Error: Job "basic" is already started
This error cannot be caught in try...catch or Promise.prototype.catch().
The error occurs due to an incorrect call to an asynchronous function in a loop:
for (const job of this.config.jobs) {
this.start(job.name);
}
Perhaps it is better to replace with this code for correct error handling:
try {
let p = this.config.jobs.map(job=>this.start(job.name))
let a = await Promise.allSettled(p)
a = a.filter(result=>result.status === 'rejected').map(j=>j.reason)
if(a.length) return a
return
} catch (error) {return error}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When launching bree with express, re-call bree.start() throws an exception for already started jobs and node app crashed.
This error cannot be caught in try...catch or Promise.prototype.catch().
The error occurs due to an incorrect call to an asynchronous function in a loop:
Perhaps it is better to replace with this code for correct error handling:
Beta Was this translation helpful? Give feedback.
All reactions