Documentation ¶
Index ¶
- Constants
- func InitTask()
- type EffectJob
- type ExpiryJob
- type RunJob
- type Task
- func (t *Task) Add(db *gorm.DB, p model.Task) (err error)
- func (t *Task) AddJob(spec string, cmd cron.Job) (jobId cron.EntryID, err error)
- func (t *Task) Begin()
- func (t *Task) Commit()
- func (t *Task) Initialize() (err error)
- func (t *Task) RollBack()
- func (t *Task) Run(p model.Task) (err error)
- func (t *Task) Stop(id int64, tType taskType) (err error)
- func (t *Task) StopAll(id int64)
- func (t *Task) StopEffect(id int64)
- func (t *Task) StopExpire(id int64)
- func (t *Task) StopRun(id int64)
Constants ¶
View Source
const ( MaxPageSize = 1000 MaxQueueSize = 10 OnceFormat = "04 15 02 01" )
View Source
const ( EffectType taskType = iota ExpiryType )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Task ¶
type Task struct { Cron *cron.Cron EntryIDs []cron.EntryID // 存放事务的id列表 // contains filtered or unexported fields }
var (
T *Task
)
func (*Task) Initialize ¶
Initialize 初始化任务, 从数据库取出所有任务, 添加到定时任务并运行
func (*Task) StopEffect ¶
func (*Task) StopExpire ¶
Click to show internal directories.
Click to hide internal directories.