2024-07-15 00:30:33 +08:00
|
|
|
import { Autoload, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
|
|
|
|
import { PipelineService } from '../service/pipeline-service.js';
|
|
|
|
|
import { logger } from '../../../utils/logger.js';
|
2023-01-29 13:44:19 +08:00
|
|
|
|
|
|
|
|
@Autoload()
|
|
|
|
|
@Scope(ScopeEnum.Singleton)
|
|
|
|
|
export class AutoRegisterCron {
|
|
|
|
|
@Inject()
|
|
|
|
|
pipelineService: PipelineService;
|
|
|
|
|
|
|
|
|
|
// @Inject()
|
|
|
|
|
// echoPlugin: EchoPlugin;
|
|
|
|
|
|
|
|
|
|
@Init()
|
|
|
|
|
async init() {
|
|
|
|
|
logger.info('加载定时trigger开始');
|
|
|
|
|
await this.pipelineService.onStartup();
|
|
|
|
|
// logger.info(this.echoPlugin, this.echoPlugin.test);
|
|
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
}
|