1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 23:01:28 +00:00

gofmt the code

This commit is contained in:
albertma 2016-04-29 10:28:10 +08:00
parent a271d67ba4
commit e607be6fa6

View File

@ -389,16 +389,15 @@ func dayMatches(s *Schedule, t time.Time) bool {
// StartTask start all tasks // StartTask start all tasks
func StartTask() { func StartTask() {
if isstart { if isstart {
//If already started no need to start another goroutine. //If already started no need to start another goroutine.
return return
} }
isstart = true isstart = true
go run() go run()
} }
func run() { func run() {
now := time.Now().Local() now := time.Now().Local()
for _, t := range AdminTaskList { for _, t := range AdminTaskList {
t.SetNext(now) t.SetNext(now)
@ -422,7 +421,7 @@ func run() {
if e.GetNext() != effective { if e.GetNext() != effective {
break break
} }
go e.Run() go e.Run()
e.SetPrev(e.GetNext()) e.SetPrev(e.GetNext())
e.SetNext(effective) e.SetNext(effective)
} }
@ -437,10 +436,10 @@ func run() {
// StopTask stop all tasks // StopTask stop all tasks
func StopTask() { func StopTask() {
if(isstart){ if isstart {
isstart = false isstart = false
stop <- true stop <- true
} }
} }