Browse Source

new tasks should be scheduled based on the current time

Travis Terry 10 năm trước cách đây
mục cha
commit
2e451031b1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      cron.go

+ 1 - 1
cron.go

@@ -164,7 +164,7 @@ func (c *Cron) run() {
 
 		case newEntry := <-c.add:
 			c.entries = append(c.entries, newEntry)
-			newEntry.Next = newEntry.Schedule.Next(now)
+			newEntry.Next = newEntry.Schedule.Next(time.Now().Local())
 
 		case <-c.snapshot:
 			c.snapshot <- c.entrySnapshot()