Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJobBlocked = errors.New("job is blocked") BlockedLimit = 2 * time.Second )
View Source
var DefaultParser = cron.NewParser( cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor, )
DefaultParser 等于 WithSecondOptional()
Functions ¶
func IsRealBlocked ¶
func IsRealBlocked() error
IsRealBlocked 场景: 任务设置了立即执行, 00:59.999 刚开始执行, 下次执行时间 01:00 跟着就到了, 再次启动了任务, 但没抢到锁, 忽略该次 Blocked
func IsValidSpec ¶ added in v0.6.2
IsValidSpec 检查定时任务标识是否有效
Types ¶
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.