添加触发任务类型

This commit is contained in:
Akkia
2022-09-13 06:14:47 +08:00
parent 4f26f36c8e
commit 7228f334a5
3 changed files with 52 additions and 3 deletions

View File

@@ -11,11 +11,15 @@ import (
const (
CronCoverIgnoreAll = iota
CronCoverAll
CronCoverSelf
CronTypeCronTask = 0
CronTypeTriggerTask = 1
)
type Cron struct {
Common
Name string
TaskType uint8 `gorm:"default:0"` // 0:计划任务 1:触发任务
Scheduler string //分钟 小时 天 月 星期
Command string
Servers []uint64 `gorm:"-"`
@@ -23,7 +27,7 @@ type Cron struct {
NotificationTag string // 指定通知方式的分组
LastExecutedAt time.Time // 最后一次执行时间
LastResult bool // 最后一次执行结果
Cover uint8 // 计划任务覆盖范围 (0:仅覆盖特定服务器 1:仅忽略特定服务器)
Cover uint8 // 计划任务覆盖范围 (0:仅覆盖特定服务器 1:仅忽略特定服务器 2:由触发该计划任务的服务器执行)
CronJobID cron.EntryID `gorm:"-"`
ServersRaw string