@pulsecron/pulse
Advanced tools
Comparing version 1.6.4 to 1.6.5
@@ -43,4 +43,4 @@ "use strict"; | ||
priority: attrs.priority, | ||
type: type || 'once', | ||
nextRunAt: repeatAt || repeatInterval ? nextRunAt || new Date() : !lastFinishedAt ? nextRunAt || new Date() : nextRunAt, | ||
type: type || 'single', | ||
nextRunAt: nextRunAt || new Date(), | ||
}; | ||
@@ -47,0 +47,0 @@ } |
@@ -15,16 +15,40 @@ "use strict"; | ||
.updateMany({ | ||
$or: [ | ||
$and: [ | ||
{ repeatInterval: { $exists: false } }, | ||
{ repeatAt: { $exists: false } }, | ||
{ | ||
lockedAt: { $exists: true }, | ||
nextRunAt: { $ne: null }, | ||
$or: [ | ||
{ $expr: { $eq: ['$runCount', '$finishedCount'] } }, | ||
{ $or: [{ lastFinishedAt: { $exists: false } }, { lastFinishedAt: null }] }, | ||
{ | ||
lockedAt: { $exists: true }, | ||
$and: [ | ||
{ | ||
$or: [ | ||
{ nextRunAt: { $lte: now, $ne: null } }, | ||
{ nextRunAt: { $exists: false } }, | ||
{ nextRunAt: null }, | ||
], | ||
}, | ||
{ | ||
$or: [ | ||
{ $expr: { $eq: ['$runCount', '$finishedCount'] } }, | ||
{ $or: [{ lastFinishedAt: { $exists: false } }, { lastFinishedAt: null }] }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
lockedAt: { $exists: false }, | ||
$and: [ | ||
{ | ||
$or: [ | ||
{ nextRunAt: { $lte: now, $ne: null } }, | ||
{ nextRunAt: { $exists: false } }, | ||
{ nextRunAt: null }, | ||
], | ||
}, | ||
{ $or: [{ lastFinishedAt: { $exists: false } }, { lastFinishedAt: null }] }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
lockedAt: { $exists: false }, | ||
$or: [{ lastFinishedAt: { $exists: false } }, { lastFinishedAt: null }], | ||
nextRunAt: { $lte: now, $ne: null }, | ||
}, | ||
], | ||
@@ -44,3 +68,16 @@ }, { | ||
{ $or: [{ repeatInterval: { $exists: true } }, { repeatAt: { $exists: true } }] }, | ||
{ $or: [{ nextRunAt: { $lte: now } }, { nextRunAt: { $exists: false } }, { nextRunAt: null }] }, | ||
{ | ||
$or: [ | ||
{ nextRunAt: { $lte: now } }, | ||
{ nextRunAt: { $exists: false } }, | ||
{ nextRunAt: null }, | ||
], | ||
}, | ||
{ | ||
$or: [ | ||
{ lastFinishedAt: { $exists: false } }, | ||
{ lastFinishedAt: { $lte: now } }, | ||
{ lastFinishedAt: null }, | ||
], | ||
}, | ||
], | ||
@@ -47,0 +84,0 @@ }) |
{ | ||
"name": "@pulsecron/pulse", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "The modern MongoDB-powered job scheduler library for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
192938
2296