Skip to content

Commit

Permalink
fix: temporary mongodb outages stop job-queue forever
Browse files Browse the repository at this point in the history
hopefully fixes msavin#92
  • Loading branch information
macrozone authored Apr 26, 2021
1 parent 3db5623 commit 59b00d7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions package/server/imports/operator/queue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ queue.prototype.trigger = function () {
var self = this;

if (self.available === true && self.interval) {
self.available = false;
try {
self.available = false;

if (dominator.isActive()) {
self.run()
} else {
if (dominator.isActive()) {
self.run()
} else {
self.available = true;
}
} catch(e) {
console.error(e);
} finally {
self.available = true;
}
}
Expand Down Expand Up @@ -114,4 +120,4 @@ queue.prototype.run = function () {
}
}

export { queue }
export { queue }

0 comments on commit 59b00d7

Please sign in to comment.