@rvoh/psychic-workers 2.9.0 → 2.9.1
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/cjs/src/background/BaseScheduledService.js +4 -1
- package/dist/cjs/src/background/index.js +2 -2
- package/dist/esm/src/background/BaseScheduledService.js +4 -1
- package/dist/esm/src/background/index.js +2 -2
- package/dist/types/src/background/BaseScheduledService.d.ts +4 -1
- package/dist/types/src/background/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,9 @@ export default class BaseScheduledService {
|
|
|
46
46
|
* ```ts
|
|
47
47
|
* await MySchedulableClass.schedule('0 * * * *', 'myHourlyMethod', 'abc', 123)
|
|
48
48
|
* ```
|
|
49
|
+
* The cron `pattern` is evaluated in UTC, independent of the worker
|
|
50
|
+
* process's time zone. For example, `'0 9 * * *'` runs daily at 09:00 UTC.
|
|
51
|
+
*
|
|
49
52
|
* Awaiting `schedule` confirms that the BullMQ job scheduler has been
|
|
50
53
|
* registered or updated in Redis. It does not invoke the method inline or
|
|
51
54
|
* wait for any scheduled run to complete. Independent queue workers may
|
|
@@ -56,7 +59,7 @@ export default class BaseScheduledService {
|
|
|
56
59
|
* the scheduled job, call `WorkerTestUtils.workScheduled()`, or invoke the
|
|
57
60
|
* method directly to test its body.
|
|
58
61
|
*
|
|
59
|
-
* @param pattern - A cron string representing the time interval you wish this to run on
|
|
62
|
+
* @param pattern - A cron string evaluated in UTC, representing the time interval you wish this to run on
|
|
60
63
|
* @param methodName - the name of the static method you wish to run in the background
|
|
61
64
|
* @param args - a variadic list of arguments to be sent to your method
|
|
62
65
|
*/
|
|
@@ -723,7 +723,7 @@ export class Background {
|
|
|
723
723
|
* to be scheduled to run at a specified cron pattern
|
|
724
724
|
*
|
|
725
725
|
* @param ObjectClass - the class you wish to background
|
|
726
|
-
* @param pattern - the cron string
|
|
726
|
+
* @param pattern - the cron string, evaluated in UTC, governing the scheduling for this job
|
|
727
727
|
* @param method - the method you wish to background
|
|
728
728
|
* @param globalName - the globalName of the class you are processing
|
|
729
729
|
* @param args - (optional) a list of arguments to provide to your method when it is called
|
|
@@ -736,7 +736,7 @@ export class Background {
|
|
|
736
736
|
const queueInstance = this.queueInstance(jobConfig);
|
|
737
737
|
if (!queueInstance)
|
|
738
738
|
throw new Error(`Missing queue for: ${jobConfig.queue?.toString()}`);
|
|
739
|
-
await queueInstance.upsertJobScheduler(schedulerId, { pattern }, {
|
|
739
|
+
await queueInstance.upsertJobScheduler(schedulerId, { pattern, tz: 'UTC' }, {
|
|
740
740
|
name: 'BackgroundJobQueueStaticJob',
|
|
741
741
|
// the priority from the service's `backgroundJobConfig`, written where open-source
|
|
742
742
|
// BullMQ reads it. Without it BullMQ enqueues every cron run at no priority at all,
|
|
@@ -46,6 +46,9 @@ export default class BaseScheduledService {
|
|
|
46
46
|
* ```ts
|
|
47
47
|
* await MySchedulableClass.schedule('0 * * * *', 'myHourlyMethod', 'abc', 123)
|
|
48
48
|
* ```
|
|
49
|
+
* The cron `pattern` is evaluated in UTC, independent of the worker
|
|
50
|
+
* process's time zone. For example, `'0 9 * * *'` runs daily at 09:00 UTC.
|
|
51
|
+
*
|
|
49
52
|
* Awaiting `schedule` confirms that the BullMQ job scheduler has been
|
|
50
53
|
* registered or updated in Redis. It does not invoke the method inline or
|
|
51
54
|
* wait for any scheduled run to complete. Independent queue workers may
|
|
@@ -56,7 +59,7 @@ export default class BaseScheduledService {
|
|
|
56
59
|
* the scheduled job, call `WorkerTestUtils.workScheduled()`, or invoke the
|
|
57
60
|
* method directly to test its body.
|
|
58
61
|
*
|
|
59
|
-
* @param pattern - A cron string representing the time interval you wish this to run on
|
|
62
|
+
* @param pattern - A cron string evaluated in UTC, representing the time interval you wish this to run on
|
|
60
63
|
* @param methodName - the name of the static method you wish to run in the background
|
|
61
64
|
* @param args - a variadic list of arguments to be sent to your method
|
|
62
65
|
*/
|
|
@@ -723,7 +723,7 @@ export class Background {
|
|
|
723
723
|
* to be scheduled to run at a specified cron pattern
|
|
724
724
|
*
|
|
725
725
|
* @param ObjectClass - the class you wish to background
|
|
726
|
-
* @param pattern - the cron string
|
|
726
|
+
* @param pattern - the cron string, evaluated in UTC, governing the scheduling for this job
|
|
727
727
|
* @param method - the method you wish to background
|
|
728
728
|
* @param globalName - the globalName of the class you are processing
|
|
729
729
|
* @param args - (optional) a list of arguments to provide to your method when it is called
|
|
@@ -736,7 +736,7 @@ export class Background {
|
|
|
736
736
|
const queueInstance = this.queueInstance(jobConfig);
|
|
737
737
|
if (!queueInstance)
|
|
738
738
|
throw new Error(`Missing queue for: ${jobConfig.queue?.toString()}`);
|
|
739
|
-
await queueInstance.upsertJobScheduler(schedulerId, { pattern }, {
|
|
739
|
+
await queueInstance.upsertJobScheduler(schedulerId, { pattern, tz: 'UTC' }, {
|
|
740
740
|
name: 'BackgroundJobQueueStaticJob',
|
|
741
741
|
// the priority from the service's `backgroundJobConfig`, written where open-source
|
|
742
742
|
// BullMQ reads it. Without it BullMQ enqueues every cron run at no priority at all,
|
|
@@ -38,6 +38,9 @@ export default class BaseScheduledService {
|
|
|
38
38
|
* ```ts
|
|
39
39
|
* await MySchedulableClass.schedule('0 * * * *', 'myHourlyMethod', 'abc', 123)
|
|
40
40
|
* ```
|
|
41
|
+
* The cron `pattern` is evaluated in UTC, independent of the worker
|
|
42
|
+
* process's time zone. For example, `'0 9 * * *'` runs daily at 09:00 UTC.
|
|
43
|
+
*
|
|
41
44
|
* Awaiting `schedule` confirms that the BullMQ job scheduler has been
|
|
42
45
|
* registered or updated in Redis. It does not invoke the method inline or
|
|
43
46
|
* wait for any scheduled run to complete. Independent queue workers may
|
|
@@ -48,7 +51,7 @@ export default class BaseScheduledService {
|
|
|
48
51
|
* the scheduled job, call `WorkerTestUtils.workScheduled()`, or invoke the
|
|
49
52
|
* method directly to test its body.
|
|
50
53
|
*
|
|
51
|
-
* @param pattern - A cron string representing the time interval you wish this to run on
|
|
54
|
+
* @param pattern - A cron string evaluated in UTC, representing the time interval you wish this to run on
|
|
52
55
|
* @param methodName - the name of the static method you wish to run in the background
|
|
53
56
|
* @param args - a variadic list of arguments to be sent to your method
|
|
54
57
|
*/
|
|
@@ -273,7 +273,7 @@ export declare class Background {
|
|
|
273
273
|
* to be scheduled to run at a specified cron pattern
|
|
274
274
|
*
|
|
275
275
|
* @param ObjectClass - the class you wish to background
|
|
276
|
-
* @param pattern - the cron string
|
|
276
|
+
* @param pattern - the cron string, evaluated in UTC, governing the scheduling for this job
|
|
277
277
|
* @param method - the method you wish to background
|
|
278
278
|
* @param globalName - the globalName of the class you are processing
|
|
279
279
|
* @param args - (optional) a list of arguments to provide to your method when it is called
|