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