Skip to content

Commit

Permalink
[FIX] Notification worker stopping on error (#20605)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego authored Feb 11, 2021
1 parent 7765759 commit 592622c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/notification-queue/server/NotificationQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ class NotificationClass {
return;
}

setTimeout(this.worker.bind(this), this.cyclePause);
setTimeout(() => {
try {
this.worker.bind(this);
} catch (e) {
console.error('Error sending notification', e);
this.executeWorkerLater.bind(this);
}
}, this.cyclePause);
}

async worker(counter = 0): Promise<void> {
Expand Down

0 comments on commit 592622c

Please sign in to comment.