- 一些同步的任务名添加关键信息

This commit is contained in:
gazebo
2019-04-16 09:42:36 +08:00
parent 98e873f0b2
commit cb35d92feb
2 changed files with 13 additions and 9 deletions

View File

@@ -25,6 +25,10 @@ const (
TaskStatusEnd = 4
)
const (
MaxTaskNameLen = 30
)
var (
TaskStatusName = map[int]string{
TaskStatusWorking: "运行中",
@@ -136,7 +140,7 @@ func (t *BaseTask) Init(parallelCount, batchSize int, isContinueWhenError bool,
t.BatchSize = batchSize
t.IsContinueWhenError = isContinueWhenError
t.params = params
t.Name = name
t.Name = utils.LimitUTF8StringLen(name, MaxTaskNameLen)
t.CreatedAt = time.Now()
t.ctx = ctx
t.CreatedBy = ctx.GetUserName()