|
|
@ -124,7 +124,7 @@ module.exports = function (state) {
|
|
|
|
buffer(),
|
|
|
|
buffer(),
|
|
|
|
globalRateLimiter,
|
|
|
|
globalRateLimiter,
|
|
|
|
processTaskSafely(task, (item, tx) => {
|
|
|
|
processTaskSafely(task, (item, tx) => {
|
|
|
|
console.log(`[started] ${item.id}`);
|
|
|
|
console.log(`[${task}][started] ${item.id}`);
|
|
|
|
|
|
|
|
|
|
|
|
let context = { tx, item, task, taskVersion };
|
|
|
|
let context = { tx, item, task, taskVersion };
|
|
|
|
|
|
|
|
|
|
|
@ -167,7 +167,7 @@ module.exports = function (state) {
|
|
|
|
expires_at: dateFns.add(new Date(), { seconds: ttlInSeconds })
|
|
|
|
expires_at: dateFns.add(new Date(), { seconds: ttlInSeconds })
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
console.warn(`[failed] ${item.id}`, error);
|
|
|
|
console.warn(`[${task}][failed] ${item.id}`, error);
|
|
|
|
|
|
|
|
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
// Task failed -- note, cannot use tx here because it has failed
|
|
|
|
// Task failed -- note, cannot use tx here because it has failed
|
|
|
|