@resolveio/server-lib 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/managers/cron.manager.js +6 -1
- package/package.json +1 -1
package/managers/cron.manager.js
CHANGED
|
@@ -138,7 +138,12 @@ var CronManager = /** @class */ (function () {
|
|
|
138
138
|
CronManager.prototype.runCronJob = function (cron) {
|
|
139
139
|
var _this = this;
|
|
140
140
|
var now = new Date();
|
|
141
|
-
|
|
141
|
+
var cronRunTime = null;
|
|
142
|
+
if (cron.next_run) {
|
|
143
|
+
cronRunTime = cron.next_run;
|
|
144
|
+
cronRunTime.setSeconds(0, 0);
|
|
145
|
+
}
|
|
146
|
+
if (!cron.next_run || now.getTime() >= cronRunTime.getTime()) {
|
|
142
147
|
cron_job_collection_1.CronJobs.findOneAndUpdate({
|
|
143
148
|
$and: [
|
|
144
149
|
{ _id: cron._id },
|