mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
5724c04bc3
# Conflicts: # packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/index.vue # packages/ui/certd-server/src/plugins/plugin-other/plugins/plugin-restart.ts
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
|
import { PipelineService } from '../pipeline/service/pipeline-service.js';
|
|
import { logger } from '../../utils/logger.js';
|
|
import { SysSettingsService } from '../system/service/sys-settings-service.js';
|
|
|
|
@Autoload()
|
|
@Scope(ScopeEnum.Singleton)
|
|
export class AutoRegisterCron {
|
|
@Inject()
|
|
pipelineService: PipelineService;
|
|
|
|
@Config('cron.onlyAdminUser')
|
|
private onlyAdminUser: boolean;
|
|
|
|
// @Inject()
|
|
// echoPlugin: EchoPlugin;
|
|
@Config('cron.immediateTriggerOnce')
|
|
private immediateTriggerOnce = false;
|
|
|
|
@Inject()
|
|
sysSettingsService: SysSettingsService;
|
|
|
|
@Init()
|
|
async init() {
|
|
logger.info('加载定时trigger开始');
|
|
|
|
await this.pipelineService.onStartup(this.immediateTriggerOnce, this.onlyAdminUser);
|
|
logger.info('加载定时trigger完成');
|
|
//
|
|
// const meta = getClassMetadata(CLASS_KEY, this.echoPlugin);
|
|
// console.log('meta', meta);
|
|
// const metas = listPropertyDataFromClass(CLASS_KEY, this.echoPlugin);
|
|
// console.log('metas', metas);
|
|
}
|
|
}
|