From 413e436c615b9bb3b8eb18dd8546b258d208f22d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 19 Nov 2019 15:35:43 +0100 Subject: [PATCH] Revert "fix(cron): consider scheduling precision in all time comparisons" This reverts commit 4ded04b80df94a4655af52b64cbcd156394286fd. --- src/Cron.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cron.hs b/src/Cron.hs index fe78ac694..5017e71d1 100644 --- a/src/Cron.hs +++ b/src/Cron.hs @@ -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