修改定时规则类型

This commit is contained in:
whyour
2025-02-21 01:35:08 +08:00
parent 8173075b67
commit fa83761d27
7 changed files with 116 additions and 87 deletions
+13
View File
@@ -0,0 +1,13 @@
import { ScheduleType } from './type';
export const scheduleTypeMap = {
[ScheduleType.Normal]: '',
[ScheduleType.Once]: '@once',
[ScheduleType.Boot]: '@boot',
};
export const getScheduleType = (schedule?: string): ScheduleType => {
if (schedule?.startsWith('@once')) return ScheduleType.Once;
if (schedule?.startsWith('@boot')) return ScheduleType.Boot;
return ScheduleType.Normal;
};