diff --git a/src/Jobs.hs b/src/Jobs.hs index f667d0edb..cdcf5d3d7 100644 --- a/src/Jobs.hs +++ b/src/Jobs.hs @@ -334,7 +334,7 @@ execCrontab = do lastTimes <- State.get now <- liftIO getCurrentTime let currentCrontab' = sortOn cmpProj . flip map (HashMap.toList currentCrontab) $ \(job, cron) -> (job, getMax <$> HashMap.lookup job lastTimes, ) $ nextCronMatch appTZ (getMax <$> HashMap.lookup job lastTimes) (debouncingAcc settings job) now cron - where cmpProj (j, lT, qT) = (qT, lT, j) + where cmpProj (j, lT, qT) = (qT, Down $ prioritiseJob j, lT, j) crontabTVar <- asks jobCurrentCrontab atomically . writeTVar crontabTVar $ Just (now, currentCrontab') $logDebugS "Crontab" . intercalate "\n" $ "Current crontab:" : map tshow currentCrontab' @@ -395,6 +395,7 @@ execCrontab = do where t = nextCronMatch appTZ (getMax <$> HashMap.lookup jobCtl lastTimes) (debouncingAcc settings jobCtl) now cron cmpProj (j, qT) = ( qT + , Down $ prioritiseJob j , getMax <$> HashMap.lookup j lastTimes , j )