@arkstack/scheduler 0.18.1 → 0.18.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/dist/commands/ScheduleListCommand.js +1 -1
- package/dist/commands/ScheduleRunCommand.js +2 -2
- package/dist/commands/ScheduleWorkCommand.js +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +2 -2
- package/dist/{loader-BgSccyLB.js → loader-CZcEYUX9.js} +1 -4
- package/dist/{runner-p2S8_S-d.js → runner-Bt-jQptE.js} +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as loadSchedule } from "../loader-
|
|
2
|
-
import { t as runDueEvents } from "../runner-
|
|
1
|
+
import { t as loadSchedule } from "../loader-CZcEYUX9.js";
|
|
2
|
+
import { t as runDueEvents } from "../runner-Bt-jQptE.js";
|
|
3
3
|
import { Command } from "@h3ravel/musket";
|
|
4
4
|
//#region src/commands/ScheduleRunCommand.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as loadSchedule } from "../loader-
|
|
2
|
-
import { t as runDueEvents } from "../runner-
|
|
1
|
+
import { t as loadSchedule } from "../loader-CZcEYUX9.js";
|
|
2
|
+
import { t as runDueEvents } from "../runner-Bt-jQptE.js";
|
|
3
3
|
import { Command } from "@h3ravel/musket";
|
|
4
4
|
//#region src/commands/ScheduleWorkCommand.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -291,9 +291,6 @@ declare const loadSchedule: () => Promise<boolean>;
|
|
|
291
291
|
/**
|
|
292
292
|
* Whether a cron expression is due at the given moment (minute resolution).
|
|
293
293
|
*
|
|
294
|
-
* Uses croner to find the next run at/after one second before `date`; the
|
|
295
|
-
* expression is due when that run falls in the same minute as `date`.
|
|
296
|
-
*
|
|
297
294
|
* @param expression A 5-field cron expression.
|
|
298
295
|
* @param date The moment to test (defaults to now).
|
|
299
296
|
* @param timezone IANA timezone the expression is evaluated in.
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as nextRun, i as isDue, n as Schedule, o as acquireLock, r as ScheduledEvent, s as releaseLock, t as loadSchedule } from "./loader-
|
|
2
|
-
import { t as runDueEvents } from "./runner-
|
|
1
|
+
import { a as nextRun, i as isDue, n as Schedule, o as acquireLock, r as ScheduledEvent, s as releaseLock, t as loadSchedule } from "./loader-CZcEYUX9.js";
|
|
2
|
+
import { t as runDueEvents } from "./runner-Bt-jQptE.js";
|
|
3
3
|
export { Schedule, ScheduledEvent, acquireLock, isDue, loadSchedule, nextRun, releaseLock, runDueEvents };
|
|
@@ -60,16 +60,13 @@ const toMinute = (date) => Math.floor(date.getTime() / 6e4);
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether a cron expression is due at the given moment (minute resolution).
|
|
62
62
|
*
|
|
63
|
-
* Uses croner to find the next run at/after one second before `date`; the
|
|
64
|
-
* expression is due when that run falls in the same minute as `date`.
|
|
65
|
-
*
|
|
66
63
|
* @param expression A 5-field cron expression.
|
|
67
64
|
* @param date The moment to test (defaults to now).
|
|
68
65
|
* @param timezone IANA timezone the expression is evaluated in.
|
|
69
66
|
*/
|
|
70
67
|
const isDue = (expression, date = /* @__PURE__ */ new Date(), timezone) => {
|
|
71
68
|
try {
|
|
72
|
-
const next = new Cron(expression, timezone ? { timezone } : {}).nextRun(/* @__PURE__ */ new Date(date
|
|
69
|
+
const next = new Cron(expression, timezone ? { timezone } : {}).nextRun(/* @__PURE__ */ new Date(toMinute(date) * 6e4 - 1e3));
|
|
73
70
|
return !!next && toMinute(next) === toMinute(date);
|
|
74
71
|
} catch {
|
|
75
72
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/scheduler",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Task scheduling for Arkstack: fluent frequencies, cron, overlap/one-server locks, hooks, and schedule:run/work/list commands.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/scheduling",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"croner": "^9.0.0",
|
|
36
|
-
"@arkstack/common": "^0.18.
|
|
36
|
+
"@arkstack/common": "^0.18.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@h3ravel/musket": "^2.2.13",
|
|
40
|
-
"@arkstack/
|
|
41
|
-
"@arkstack/
|
|
42
|
-
"@arkstack/
|
|
40
|
+
"@arkstack/cache": "^0.18.2",
|
|
41
|
+
"@arkstack/contract": "^0.18.2",
|
|
42
|
+
"@arkstack/jobs": "^0.18.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@arkstack/cache": {
|