@stacksjs/scheduler 0.58.49 → 0.58.50
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/index.js +3 -2
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/index.ts
|
|
3
3
|
import cron from "node-cron";
|
|
4
|
-
|
|
4
|
+
function run(callback) {
|
|
5
5
|
return {
|
|
6
6
|
everySecond: () => {
|
|
7
7
|
cron.schedule("* * * * * *", callback);
|
|
@@ -82,7 +82,7 @@ var run = function(callback) {
|
|
|
82
82
|
timezone ? cron.schedule(interval, callback, { scheduled: true, timezone }) : cron.schedule(interval, callback);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
function useScheduler() {
|
|
87
87
|
return {
|
|
88
88
|
run
|
|
@@ -204,5 +204,6 @@ class ScheduleImpl {
|
|
|
204
204
|
}
|
|
205
205
|
export {
|
|
206
206
|
useScheduler,
|
|
207
|
+
run,
|
|
207
208
|
ScheduleImpl
|
|
208
209
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -231,7 +231,7 @@ export interface Scheduler {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
// function run(callback: Function): Scheduler {
|
|
234
|
-
function run(callback: ((now: Date | 'manual' | 'init') => void) | string): Scheduler {
|
|
234
|
+
export function run(callback: ((now: Date | 'manual' | 'init') => void) | string): Scheduler {
|
|
235
235
|
return {
|
|
236
236
|
everySecond: () => {
|
|
237
237
|
cron.schedule('* * * * * *', callback)
|