pull/199/head
xiaojunnuo 2024-10-02 01:50:40 +08:00
parent 2ecf1cce5b
commit 93fc8dc665
3 changed files with 35 additions and 0 deletions

View File

@ -1,2 +1,3 @@
export * from './plugin-restart.js';
export * from './plugin-script.js';
export * from './plugin-wait.js';

View File

@ -0,0 +1,33 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
@IsTaskPlugin({
name: 'WaitPlugin',
title: '等待',
icon: 'ri:rest-time-line',
desc: '等待一段时间',
group: pluginGroups.other.key,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
export class WaitPlugin extends AbstractTaskPlugin {
@TaskInput({
title: '等待时长',
value: 30,
component: {
name: 'a-number',
vModel: 'value',
},
helper: '单位:秒',
required: true,
})
waitTime!: number;
async onInstance() {}
async execute(): Promise<void> {
await this.ctx.utils.sleep(this.waitTime * 1000);
}
}
new WaitPlugin();

View File

@ -1 +1,2 @@
import './dnspod-dns-provider.js';
import './tencent-dns-provider.js';