- GetCreatedBy for ITask

This commit is contained in:
gazebo
2018-11-19 21:16:12 +08:00
parent bc9f801d2d
commit e8705b12ec

View File

@@ -36,6 +36,7 @@ type ITask interface {
GetFinishedJobCount() int
GetStatus() int
GetCreatedAt() time.Time
GetCreatedBy() string
AddChild(task ITask) ITask
GetChildren() TaskList
@@ -146,12 +147,13 @@ func (t *BaseTask) GetResult(duration time.Duration) (retVal []interface{}, err
}
func (t *BaseTask) GetCreatedAt() time.Time {
t.locker.RLock()
defer t.locker.RUnlock()
return t.CreatedAt
}
func (t *BaseTask) GetCreatedBy() string {
return t.CreatedBy
}
func (t *BaseTask) Cancel() {
t.locker.Lock()
if t.Status < TaskStatusEndBegin && t.Status != TaskStatusCanceling {