Skip to content

Commit

Permalink
bugfix#编辑任务节点,主机名变更可能导致所有任务定时器被重置
Browse files Browse the repository at this point in the history
  • Loading branch information
ouqiang committed Feb 20, 2020
1 parent 9f9c663 commit 93c544f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ require (
github.com/urfave/cli v1.20.0
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
golang.org/x/net v0.0.0-20190522155817-f3200d17e092
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
golang.org/x/text v0.3.2 // indirect
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101 // indirect
google.golang.org/grpc v1.21.0
Expand Down
3 changes: 3 additions & 0 deletions internal/models/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func (task *Task) ActiveListByHostId(hostId int16) ([]Task, error) {
if err != nil {
return nil, err
}
if len(taskIds) == 0 {
return nil, nil
}
list := make([]Task, 0)
err = Db.Where("status = ? AND level = ?", Enabled, TaskLevelParent).
In("id", taskIds...).
Expand Down

0 comments on commit 93c544f

Please sign in to comment.