Procházet zdrojové kódy

Truncate schedule times to the second.

Rob Figueiredo před 13 roky
rodič
revize
5d2c261c11
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      schedule.go

+ 1 - 1
schedule.go

@@ -64,7 +64,7 @@ func (s *Schedule) Next(t time.Time) time.Time {
 	// values)
 
 	// Start at the earliest possible time.
-	t = t.Add(1 * time.Second)
+	t = t.Add(1*time.Second - time.Duration(t.Nanosecond())*time.Nanosecond)
 
 	// This flag indicates whether a field has been incremented.
 	added := false