From 1da5429a3356a93b2628232ebf442a735b20f2af Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Apr 2014 14:34:09 -0400 Subject: assistant: Fix high CPU usage triggered when a monthly fsck is scheduled, and the last time the job ran was a day of the month > 12. This caused a runaway loop. Thanks to Anarcat for his assistance, and to Maximiliano Curia for identifying the cause of this bug. --- Utility/Scheduled.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Utility/Scheduled.hs') diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index 11e3b569b..e4b03aac4 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -121,7 +121,7 @@ calcNextTime (Schedule recurrance scheduledtime) lasttime currenttime | otherwise -> skip 1 Monthly Nothing | afterday -> skip 1 - | maybe True (\old -> mnum day > mday old && mday day >= (mday old `mod` minmday)) lastday -> + | maybe True (\old -> mnum day > mnum old && mday day >= (mday old `mod` minmday)) lastday -> -- Window only covers current month, -- in case there is a Divisible requirement. Just $ window day (endOfMonth day) -- cgit v1.2.3