Merge pull request #1909 from albertma/master

Start timer task Multiple times
This commit is contained in:
astaxie 2016-04-29 11:34:52 +08:00
commit 4d8e1f93ff
1 changed files with 9 additions and 2 deletions

View File

@ -389,6 +389,10 @@ func dayMatches(s *Schedule, t time.Time) bool {
// StartTask start all tasks
func StartTask() {
if isstart {
//If already started no need to start another goroutine.
return
}
isstart = true
go run()
}
@ -432,8 +436,11 @@ func run() {
// StopTask stop all tasks
func StopTask() {
isstart = false
stop <- true
if isstart {
isstart = false
stop <- true
}
}
// AddTask add task with name