@clairejs/server 3.21.1 → 3.21.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/README.md +1 -1
- package/dist/job/AwsJobScheduler.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,17 +142,17 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
|
|
|
142
142
|
const unmatchedCronJobs = scheduledCronJobs.filter((j) => j.cron && !allJobs.find((job) => job.jobName === j.jobName && job.cron === j.cron));
|
|
143
143
|
if (unmatchedCronJobs.length) {
|
|
144
144
|
await Promise.all(unmatchedCronJobs.map((j) => this.removeJob(j.id)));
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
145
|
+
}
|
|
146
|
+
//-- reschedule new cron jobs and those which are not synced
|
|
147
|
+
const resyncCronJobs = allJobs.filter((job) => job.cron &&
|
|
148
|
+
(unmatchedCronJobs.some((j) => j.jobName === job.jobName) ||
|
|
149
|
+
!scheduledCronJobs.some((j) => j.jobName === job.jobName)));
|
|
150
|
+
this.logger.debug("Reschedule cron jobs", resyncCronJobs);
|
|
151
|
+
for (const job of resyncCronJobs) {
|
|
152
|
+
await this.scheduleJob({
|
|
153
|
+
jobName: job.jobName,
|
|
154
|
+
cron: job.cron,
|
|
155
|
+
});
|
|
156
156
|
}
|
|
157
157
|
//-- keep "at" jobs as is
|
|
158
158
|
console.log("syncJobs finished");
|