@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 +1 -1
- package/dist/job/AwsJobScheduler.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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
|
-
//
|
|
50
|
-
|
|
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
|
-
|
|
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",
|