Files
orbit/pulse/model/schedule.go

31 lines
1.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import (
"time"
core "git.yuntuo.hk/k2safe/orbit/model"
)
// Schedule 表示调度计划的当前控制状态,规则内容由不可变版本保存。
// 对应表 pulse_schedules;这是服务端持久化模型,不直接作为 API 响应。
type Schedule struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// Name 可读名称,唯一性范围由对应数据表约束。
Name string `db:"name"`
// QueueID 计划终身绑定的队列;旧结构人工行可为空,不允许参与扫描。
QueueID *core.ID `db:"queue_id"`
// ProcessingVersion 当前积压处理所用版本;发布新版本不覆盖旧进度。
ProcessingVersion uint64 `db:"processing_version"`
// CheckAt 下次允许扫描的 UTC 时间;为空表示当前没有扫描工作。
CheckAt *time.Time `db:"check_at"`
// CurrentVersion 当前生效的计划版本号,发布时与版本记录原子更新。
CurrentVersion uint64 `db:"current_version"`
// Paused 暂停标记;停止新的受控工作,不表示在途请求已停止。
Paused bool `db:"paused"`
// NextFireAt 下一原计划触发时间;版本刚切换尚待计算或已经结束时为空,需结合 CheckAt 判断。
NextFireAt *time.Time `db:"next_fire_at"`
}
func (Schedule) TableName() string { return "pulse_schedules" }