ScheduleConfig: compute delay without using loops
Also make the computation of the delay for the case "start < now" consistent with the case "now < start" i.e. make sure that the computed delay is never zero. Change-Id: I807637fdaf209f8a3b7e7a04d3504809ee591a07
This commit is contained in:
@@ -53,7 +53,7 @@ public class ScheduleConfigTest {
|
||||
|
||||
assertEquals(ms(1, HOURS), initialDelay("Mon 11:00", "1d"));
|
||||
assertEquals(ms(23, HOURS), initialDelay("Mon 09:00", "1d"));
|
||||
assertEquals(0, initialDelay("Mon 10:00", "1d"));
|
||||
assertEquals(ms(1, DAYS), initialDelay("Mon 10:00", "1d"));
|
||||
}
|
||||
|
||||
private static long initialDelay(String startTime, String interval)
|
||||
|
||||
Reference in New Issue
Block a user