mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 支持配置启动后自动触发一次任务
This commit is contained in:
@@ -8,9 +8,6 @@ const production = {
|
||||
preview: {
|
||||
enabled: false,
|
||||
},
|
||||
cron: {
|
||||
immediateTriggerOnce: true,
|
||||
},
|
||||
} as MidwayConfig;
|
||||
|
||||
mergeConfig(production, 'production');
|
||||
|
||||
@@ -9,8 +9,10 @@ export type CronTask = {
|
||||
};
|
||||
export class Cron {
|
||||
logger;
|
||||
immediateTriggerOnce: boolean;
|
||||
constructor(opts) {
|
||||
this.logger = opts.logger;
|
||||
this.immediateTriggerOnce = opts.immediateTriggerOnce;
|
||||
}
|
||||
|
||||
register(task: CronTask) {
|
||||
|
||||
Reference in New Issue
Block a user