This commit is contained in:
DanB
2014-01-10 09:10:10 +01:00

View File

@@ -40,11 +40,10 @@ func NewScheduler() *Scheduler {
func (s *Scheduler) Loop() {
for {
s.Lock()
for len(s.queue) == 0 { //hang here if empty
s.Unlock()
<-s.restartLoop
}
s.Lock()
a0 := s.queue[0]
now := time.Now()
if a0.GetNextStartTime().Equal(now) || a0.GetNextStartTime().Before(now) {