@clairejs/server 3.28.1 → 3.28.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
CHANGED
|
@@ -71,8 +71,9 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
|
|
|
71
71
|
await this.scheduler.send(deleteCommand);
|
|
72
72
|
}
|
|
73
73
|
async retryJob(job, at) {
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const { id, disabled, execCount, failCount, retryCount, lastError, lastRunAt, lastSuccessAt, ...payload } = job;
|
|
75
|
+
const jobName = this.getJobUniqueName(id);
|
|
76
|
+
if (at) {
|
|
76
77
|
//-- update the job
|
|
77
78
|
const getCommand = new GetScheduleCommand({
|
|
78
79
|
Name: jobName,
|
|
@@ -87,7 +88,7 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
|
|
|
87
88
|
}
|
|
88
89
|
else {
|
|
89
90
|
//-- schedule a new one-time job to re-execute this cron with minus one maxRetry
|
|
90
|
-
await this.scheduleJob({ ...
|
|
91
|
+
await this.scheduleJob({ ...payload, at, maxRetry: (payload.maxRetry || 0) - 1 });
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
async cleanupJob(jobId) {
|
|
@@ -147,13 +147,14 @@ let LocalJobScheduler = class LocalJobScheduler extends AbstractJobScheduler {
|
|
|
147
147
|
this.logger.debug("LocalJobScheduler exit");
|
|
148
148
|
}
|
|
149
149
|
async retryJob(job, at) {
|
|
150
|
+
const { id, disabled, execCount, failCount, retryCount, lastError, lastRunAt, lastSuccessAt, ...payload } = job;
|
|
150
151
|
if (job.at) {
|
|
151
152
|
//-- just register the job at new timestamp
|
|
152
153
|
await this.registerJob({ ...job, at });
|
|
153
154
|
}
|
|
154
155
|
else {
|
|
155
156
|
//-- schedule a new one-time job to re-execute this cron with minus one maxRetry
|
|
156
|
-
await this.scheduleJob({ ...
|
|
157
|
+
await this.scheduleJob({ ...payload, at, maxRetry: (job.maxRetry || 0) - 1 });
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
async cleanupJob(jobId) {
|