Commit 23919bdc authored by 陈子龙's avatar 陈子龙

Merge branch 'dev-czl' into dev

parents 64e49181 201e533d
...@@ -170,6 +170,7 @@ func (t *TaskHistorySvc) TaskExecLog(id int) (taskExecLogRes response.TaskExecLo ...@@ -170,6 +170,7 @@ func (t *TaskHistorySvc) TaskExecLog(id int) (taskExecLogRes response.TaskExecLo
err = resp.FAIL.WithError(errMarshal) err = resp.FAIL.WithError(errMarshal)
return return
} }
if taskExecLogRes.State == 0 {
// 写缓存 // 写缓存
err = redis.HSet(conf.TaskExecLog, strconv.Itoa(id), fmt.Sprintf("%s", taskExecLog)) err = redis.HSet(conf.TaskExecLog, strconv.Itoa(id), fmt.Sprintf("%s", taskExecLog))
if err != nil { if err != nil {
...@@ -178,6 +179,7 @@ func (t *TaskHistorySvc) TaskExecLog(id int) (taskExecLogRes response.TaskExecLo ...@@ -178,6 +179,7 @@ func (t *TaskHistorySvc) TaskExecLog(id int) (taskExecLogRes response.TaskExecLo
return return
} }
} }
}
if taskExecLogRes.State == 0 { if taskExecLogRes.State == 0 {
//判断key值是否存在 //判断key值是否存在
......
...@@ -468,6 +468,8 @@ func ExecAnsible(id, taskId int, value string) { ...@@ -468,6 +468,8 @@ func ExecAnsible(id, taskId int, value string) {
//return //return
} }
} }
err = redis.HDel(conf.TaskExecLog, strconv.Itoa(id))
conf.Logger.Error("del redis err", zap.Error(err))
redis.HDel(conf.AutoExecHistory, strconv.Itoa(id)) redis.HDel(conf.AutoExecHistory, strconv.Itoa(id))
redis.HDel(conf.TaskExecLog, strconv.Itoa(id))
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment