@clairejs/server 3.27.0 → 3.27.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
@@ -1,6 +1,6 @@
1
1
  ## Change Log
2
2
 
3
- #### 3.27.0
3
+ #### 3.27.2
4
4
 
5
5
  - use aws scheduler for jobs
6
6
 
@@ -42,19 +42,19 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
42
42
  }
43
43
  convertCronToSchedulerExpression(cron) {
44
44
  // AWS Scheduler uses a different cron format than standard cron
45
- // Standard cron: minute hour day month day-of-week
46
- // AWS Scheduler: minute hour day month day-of-week year
47
45
  const parts = cron.split(" ");
48
46
  if (parts.length === 5) {
49
- // Add year field if not present
50
- return `${cron} *`;
47
+ // Standard cron: minute hour day month day-of-week
48
+ // AWS Scheduler: minute hour day month day-of-week year
49
+ parts.push("*");
51
50
  }
52
- else if (parts.length === 6) {
53
- return cron;
54
- }
55
- else {
51
+ if (parts.length !== 6) {
56
52
  throw Errors.SYSTEM_ERROR(`Invalid cron expression: ${cron}`);
57
53
  }
54
+ if (parts[4] === "*") {
55
+ parts[4] = "?";
56
+ }
57
+ return parts.join(" ");
58
58
  }
59
59
  async cleanupJob(job) {
60
60
  if (job.at) {
@@ -103,7 +103,7 @@ let AwsJobScheduler = class AwsJobScheduler extends AbstractJobScheduler {
103
103
  if (jobInfo.at) {
104
104
  // For one-time jobs, use at() expression
105
105
  const date = new Date(jobInfo.at);
106
- scheduleExpression = `at(${date.toISOString()})`;
106
+ scheduleExpression = `at(${date.toISOString().replace(/\.\d{3}Z$/, '')})`;
107
107
  // Add flexible time window for one-time jobs to handle slight delays
108
108
  flexibleTimeWindow = {
109
109
  Mode: "OFF",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/server",
3
- "version": "3.27.0",
3
+ "version": "3.27.2",
4
4
  "description": "Claire server NodeJs framework written in Typescript.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",