Revert "fix(cron): consider scheduling precision in all time comparisons"

This reverts commit 4ded04b80d.
This commit is contained in:
Gregor Kleen 2019-11-19 15:35:43 +01:00
parent d4907cd776
commit 413e436c61

View File

@ -207,13 +207,13 @@ nextCronMatch tz mPrev prec now c@Cron{..} = case notAfter of
execRef ref wasExecd cronAbsolute = case execRef' ref wasExecd cronAbsolute of
MatchAt t
| t <= addUTCTime prec ref -> MatchAsap
| t <= ref -> MatchAsap
other -> other
execRef' ref wasExecd cronAbsolute = case cronAbsolute of
CronAsap -> MatchAt ref
CronTimestamp{ cronTimestamp = localTimeToUTCTZ tz -> ts }
| ref <= addUTCTime prec ts || not wasExecd -> MatchAt ts
| ref <= ts || not wasExecd -> MatchAt ts
| otherwise -> MatchNone
CronCalendar{..} -> listToMatch $ do
let
@ -341,7 +341,7 @@ nextCronMatch tz mPrev prec now c@Cron{..} = case notAfter of
let localTimeOfDay = TimeOfDay (fromIntegral mCronHour) (fromIntegral mCronMinute) (fromIntegral mCronSecond)
res = localTimeToUTCTZ tz LocalTime{..}
guard $ addUTCTime prec res >= ref
guard $ res >= ref
return res
CronNotScheduled -> MatchNone