This commit is contained in:
苏尹岚
2020-12-02 14:51:18 +08:00
parent 70db40b68d
commit 2d0f12a9ff

View File

@@ -278,7 +278,27 @@ func InitStation(ctx *jxcontext.Context) (err error) {
deleteList = append(deleteList, v)
}
}
task := tasksch.NewParallelTask("InitStation", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)
switch step {
case 0:
if len(addList) > 0 {
err = dao.CreateMultiEntities(db, addList)
}
case 1:
if len(updateList) > 0 {
}
case 2:
if len(deleteList) > 0 {
}
}
return retVal, err
}, []int{0, 1, 2})
tasksch.HandleTask(task, nil, true).Run()
_, err = task.GetResult(0)
return err
}