- BaseTask.GetID
This commit is contained in:
@@ -25,6 +25,7 @@ type TaskList []ITask
|
||||
|
||||
type ITask interface {
|
||||
Run()
|
||||
GetID() string
|
||||
GetResult(duration time.Duration) (retVal []interface{}, err error)
|
||||
Cancel()
|
||||
GetTotalItemCount() int
|
||||
@@ -104,6 +105,10 @@ func (t *BaseTask) Init(parallelCount, batchSize int, isContinueWhenError bool,
|
||||
t.C = t.finishChan
|
||||
}
|
||||
|
||||
func (t *BaseTask) GetID() string {
|
||||
return t.ID
|
||||
}
|
||||
|
||||
func (t *BaseTask) GetResult(duration time.Duration) (retVal []interface{}, err error) {
|
||||
if t.GetStatus() >= TaskStatusEndBegin {
|
||||
return t.Result, t.Err
|
||||
|
||||
Reference in New Issue
Block a user