Browse Source

Fix time.Timer-leak in scheduler

This caused increasing CPU load over time in the commands 'http'
and 'interactive'.
Martin Hebnes Pedersen 3 years ago
parent
commit
f4cf7c129d
1 changed files with 1 additions and 2 deletions
  1. 1 2
      schedule.go

+ 1 - 2
schedule.go

@@ -28,8 +28,7 @@ func scheduleLoop() {
 	}
 
 	go func() {
-		for {
-			<-time.Tick(time.Second)
+		for range time.Tick(time.Second) {
 			for _, j := range jobs {
 				if time.Now().Before(j.next) {
 					continue