mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 17:20:50 +00:00
gofmt the code
This commit is contained in:
parent
a271d67ba4
commit
e607be6fa6
@ -389,16 +389,15 @@ 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
|
||||
}
|
||||
if isstart {
|
||||
//If already started, no need to start another goroutine.
|
||||
return
|
||||
}
|
||||
isstart = true
|
||||
go run()
|
||||
}
|
||||
|
||||
func run() {
|
||||
|
||||
now := time.Now().Local()
|
||||
for _, t := range AdminTaskList {
|
||||
t.SetNext(now)
|
||||
@ -422,7 +421,7 @@ func run() {
|
||||
if e.GetNext() != effective {
|
||||
break
|
||||
}
|
||||
go e.Run()
|
||||
go e.Run()
|
||||
e.SetPrev(e.GetNext())
|
||||
e.SetNext(effective)
|
||||
}
|
||||
@ -437,10 +436,10 @@ func run() {
|
||||
|
||||
// StopTask stop all tasks
|
||||
func StopTask() {
|
||||
if(isstart){
|
||||
isstart = false
|
||||
stop <- true
|
||||
}
|
||||
if isstart {
|
||||
isstart = false
|
||||
stop <- true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user