Преглед на файлове

Truncate schedule times to the second.

Rob Figueiredo преди 13 години
родител
ревизия
5d2c261c11
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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