@clairejs/server 3.28.1 → 3.28.3

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
@@ -1,6 +1,6 @@
1
1
  ## Change Log
2
2
 
3
- #### 3.28.1
3
+ #### 3.28.3
4
4
 
5
5
  - implement new job scheduler
6
6
 
@@ -71,7 +71,8 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
71
71
  await this.scheduler.send(deleteCommand);
72
72
  }
73
73
  async retryJob(job, at) {
74
- const jobName = this.getJobUniqueName(job.id);
74
+ const { id, disabled, execCount, failCount, retryCount, lastError, lastRunAt, lastSuccessAt, ...payload } = job;
75
+ const jobName = this.getJobUniqueName(id);
75
76
  if (job.at) {
76
77
  //-- update the job
77
78
  const getCommand = new GetScheduleCommand({
@@ -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({ ...job, at, maxRetry: (job.maxRetry || 0) - 1 });
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({ ...job, at, maxRetry: (job.maxRetry || 0) - 1 });
157
+ await this.scheduleJob({ ...payload, at, maxRetry: (job.maxRetry || 0) - 1 });
157
158
  }
158
159
  }
159
160
  async cleanupJob(jobId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/server",
3
- "version": "3.28.1",
3
+ "version": "3.28.3",
4
4
  "description": "Claire server NodeJs framework written in Typescript.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",