Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
iwannay committed Jan 22, 2018
1 parent e26f963 commit 69e1c3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ server/autobuild
server/jiacrontab
server/watchbin
server/.data
server/server
clent/client


14 changes: 10 additions & 4 deletions client/crontab.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,12 @@ func (c *crontab) run() {
c.lock.Unlock()
if handle.taskPool != nil {
for k, v := range handle.taskPool {
v.cancel()
log.Println("kill", task.Name, task.Id, k)
if v.cancel == nil {
log.Println("kill", task.Name, task.Id, k, "but cancel handler is nul")
} else {
v.cancel()
log.Println("kill", task.Name, task.Id, k)
}
}

}
Expand Down Expand Up @@ -422,8 +426,10 @@ func (c *crontab) deal(task *proto.TaskArgs, ctx context.Context) {
cancelPool := h.taskPool[0 : l-task.MaxConcurrent]
h.taskPool = h.taskPool[l-task.MaxConcurrent:]
for k, v := range cancelPool {
v.cancel()
log.Printf("taskPool: clean %s %d", v.name, k)
if v.cancel != nil {
v.cancel()
log.Printf("taskPool: clean %s %d", v.name, k)
}
}
}
taskEty.exec(nil)
Expand Down

0 comments on commit 69e1c3c

Please sign in to comment.