diff options
-rw-r--r-- | Utility/Scheduled.hs | 17 | ||||
-rw-r--r-- | debian/changelog | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index 1b25cb4c7..4dfa4d04c 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -14,6 +14,7 @@ module Utility.Scheduled ( MonthDay, YearDay, nextTime, + calcNextTime, startTime, fromSchedule, fromScheduledTime, @@ -22,7 +23,7 @@ module Utility.Scheduled ( toRecurrance, toSchedule, parseSchedule, - prop_schedule_roundtrips + prop_schedule_roundtrips, ) where import Utility.Data @@ -127,14 +128,14 @@ calcNextTime schedule@(Schedule recurrance scheduledtime) lasttime currenttime | otherwise -> skip 1 Monthly Nothing | afterday -> skip 1 - | maybe True (\old -> mday candidate > mday old && mday candidate >= (mday old `mod` minmday)) lastday -> - -- Window only covers current month, - -- in case there is a Divisible requirement. + -- any day in the month following lasttime + | maybe True (\old -> (mnum candidate > mnum old || ynum candidate > ynum old)) lastday -> Just $ window candidate (endOfMonth candidate) | otherwise -> skip 1 Yearly Nothing | afterday -> skip 1 - | maybe True (\old -> ynum candidate > ynum old && yday candidate >= (yday old `mod` minyday)) lastday -> + -- any day in the year following lasttime + | maybe True (\old -> ynum candidate > ynum old) lastday -> Just $ window candidate (endOfYear candidate) | otherwise -> skip 1 Weekly (Just w) @@ -200,17 +201,13 @@ yday = snd . toOrdinalDate ynum :: Day -> Int ynum = fromIntegral . fst . toOrdinalDate -{- Calendar max and mins. -} +{- Calendar max values. -} maxyday :: Int maxyday = 366 -- with leap days -minyday :: Int -minyday = 365 maxwnum :: Int maxwnum = 53 -- some years have more than 52 maxmday :: Int maxmday = 31 -minmday :: Int -minmday = 28 maxmnum :: Int maxmnum = 12 maxwday :: Int diff --git a/debian/changelog b/debian/changelog index a883ddda9..6b5a205e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (5.20140413) UNRELEASED; urgency=medium + + * Improve handling on monthly/yearly scheduling. + + -- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 21:33:35 -0400 + git-annex (5.20140412) unstable; urgency=high * Last release didn't quite fix the high cpu issue in all cases, this should. |