Documentation ¶
Index ¶
- Variables
- func NewGormExecutionDAO(db *gorm.DB) storage.ExecutionDAO
- type Execution
- type GormExecutionDAO
- func (h *GormExecutionDAO) Create(ctx context.Context, tid int64) (int64, error)
- func (h *GormExecutionDAO) GetLastExecution(ctx context.Context, tid int64) (task.Execution, error)
- func (h *GormExecutionDAO) ToDomain(e Execution) task.Execution
- func (h *GormExecutionDAO) Update(ctx context.Context, eid int64, status task.ExecStatus, progress int) error
- func (h *GormExecutionDAO) Upsert(ctx context.Context, id int64, status task.ExecStatus, progress uint8) (int64, error)
- type GormTaskCfgRepository
- type Preempter
- type TaskInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToPreempt = errors.New("抢占失败") ErrTaskNotHold = errors.New("未持有任务") )
Functions ¶
func NewGormExecutionDAO ¶
func NewGormExecutionDAO(db *gorm.DB) storage.ExecutionDAO
Types ¶
type Execution ¶
type Execution struct { ID int64 `gorm:"primary_key;auto_increment"` Tid int64 // 任务执行进度 Progress uint8 Status uint8 Ctime int64 Utime int64 }
Execution 任务执行记录
type GormExecutionDAO ¶
type GormExecutionDAO struct {
// contains filtered or unexported fields
}
func (*GormExecutionDAO) GetLastExecution ¶
func (*GormExecutionDAO) Update ¶
func (h *GormExecutionDAO) Update(ctx context.Context, eid int64, status task.ExecStatus, progress int) error
type GormTaskCfgRepository ¶
type GormTaskCfgRepository struct {
// contains filtered or unexported fields
}
func NewGormTaskCfgRepository ¶
func NewGormTaskCfgRepository(db *gorm.DB) *GormTaskCfgRepository
func (*GormTaskCfgRepository) Stop ¶
func (g *GormTaskCfgRepository) Stop(ctx context.Context, id int64) error
func (*GormTaskCfgRepository) UpdateNextTime ¶
type Preempter ¶
type Preempter struct {
// contains filtered or unexported fields
}
func NewPreempter ¶
Click to show internal directories.
Click to hide internal directories.