-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packages updated and CronJob configuration adjusted accordingly
- Loading branch information
Showing
9 changed files
with
591 additions
and
668 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/core/common/interfaces/cron-job-config-with-time-zone.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { CronJobParams, CronOnCompleteCommand } from 'cron'; | ||
import { CronJobConfig } from './cron-job-config.interface'; | ||
|
||
/** | ||
* Interface for cron job configuration | ||
* | ||
* This config can define timezone but not utcOffset, | ||
* if you want to use utcOffset, you have to use the CronJobConfigWithUtcOffset | ||
*/ | ||
export interface CronJobConfigWithTimeZone<OC extends CronOnCompleteCommand | null = null, C = null> extends CronJobConfig { | ||
/** | ||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. | ||
* If the timezone is invalid, an error is thrown. Can be any string accepted by luxon's `DateTime.setZone()` | ||
* (https://moment.github.io/luxon/api-docs/index.html#datetimesetzone). | ||
*/ | ||
timeZone?: CronJobParams<OC, C>['timeZone']; | ||
|
||
/** | ||
* This allows you to specify the offset of the timezone rather than using the `timeZone` parameter. | ||
* Probably don't use both `timeZone` and `utcOffset` together or weird things may happen. | ||
*/ | ||
utcOffset?: null; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/core/common/interfaces/cron-job-config-with-utc-offset.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CronJobParams, CronOnCompleteCommand } from 'cron'; | ||
import { CronJobConfig } from './cron-job-config.interface'; | ||
|
||
/** | ||
* Interface for cron job configuration | ||
* | ||
* This config can define utcOffset but not timezone, | ||
* if you want to use timezone, you have to use the CronJobConfigWithTimezone | ||
*/ | ||
export interface CronJobConfigWithUtcOffset<OC extends CronOnCompleteCommand | null = null, C = null> extends CronJobConfig { | ||
|
||
/** | ||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. | ||
* If the timezone is invalid, an error is thrown. Can be any string accepted by luxon's `DateTime.setZone()` | ||
* (https://moment.github.io/luxon/api-docs/index.html#datetimesetzone). | ||
*/ | ||
timeZone?: null; | ||
|
||
/** | ||
* This allows you to specify the offset of the timezone rather than using the `timeZone` parameter. | ||
* Probably don't use both `timeZone` and `utcOffset` together or weird things may happen. | ||
*/ | ||
utcOffset?: CronJobParams<OC, C>['unrefTimeout']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters