chore(crontab): ldap avs synchs restricted to night hours
This commit is contained in:
parent
9992bf2b8d
commit
16f34258ba
@ -324,7 +324,7 @@ determineCrontab = execWriterT $ do
|
||||
, jIteration = fromInteger nextInterval
|
||||
})
|
||||
Cron
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ $ toTimeOfDay 23 30 0 $ utctDay nextIntervalTime
|
||||
, cronRepeat = CronRepeatNever
|
||||
, cronRateLimit = appSynchroniseLdapUsersInterval
|
||||
, cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appSynchroniseLdapUsersInterval nextIntervalTime
|
||||
@ -337,6 +337,7 @@ determineCrontab = execWriterT $ do
|
||||
, Just syncWithin <- appSynchroniseAvsUsersWithin
|
||||
, Just cInterval <- appJobCronInterval
|
||||
-> do
|
||||
now <- liftIO getCurrentTime
|
||||
nextIntervals <- getNextIntervals syncWithin appSynchroniseAvsUsersInterval cInterval
|
||||
|
||||
forM_ nextIntervals $ \(nextEpoch, nextInterval, nextIntervalTime, numIntervals) -> do
|
||||
@ -345,12 +346,12 @@ determineCrontab = execWriterT $ do
|
||||
{ jEpoch = fromInteger nextEpoch
|
||||
, jNumIterations = fromInteger numIntervals
|
||||
, jIteration = fromInteger nextInterval
|
||||
, jSynchAfter = Nothing
|
||||
, jSynchAfter = Just $ addWeeks (-1) now -- at most once per week
|
||||
})
|
||||
Cron
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ $ toTimeOfDay 22 0 0 $ utctDay nextIntervalTime
|
||||
, cronRepeat = CronRepeatNever
|
||||
, cronRateLimit = appSynchroniseLdapUsersInterval
|
||||
, cronRateLimit = appSynchroniseAvsUsersInterval
|
||||
, cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appSynchroniseAvsUsersInterval nextIntervalTime
|
||||
}
|
||||
| otherwise
|
||||
@ -367,28 +368,28 @@ determineCrontab = execWriterT $ do
|
||||
}
|
||||
)
|
||||
Cron
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ $ toTimeOfDay 22 0 0 $ utctDay nextIntervalTime
|
||||
, cronRepeat = CronRepeatNever
|
||||
, cronRateLimit = appPruneUnreferencedFilesInterval
|
||||
, cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appPruneUnreferencedFilesInterval nextIntervalTime
|
||||
}
|
||||
|
||||
whenIsJust ((,) <$> appStudyFeaturesRecacheRelevanceWithin <*> appJobCronInterval) $ \(within, cInterval) -> do
|
||||
nextIntervals <- getNextIntervals within appStudyFeaturesRecacheRelevanceInterval cInterval
|
||||
forM_ nextIntervals $ \(nextEpoch, nextInterval, nextIntervalTime, numIntervals) -> do
|
||||
tell $ HashMap.singleton
|
||||
(JobCtlQueue JobStudyFeaturesRecacheRelevance
|
||||
{ jEpoch = fromInteger nextEpoch
|
||||
, jNumIterations = fromInteger numIntervals
|
||||
, jIteration = fromInteger nextInterval
|
||||
}
|
||||
)
|
||||
Cron
|
||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
|
||||
, cronRepeat = CronRepeatNever
|
||||
, cronRateLimit = appStudyFeaturesRecacheRelevanceInterval
|
||||
, cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appStudyFeaturesRecacheRelevanceInterval nextIntervalTime
|
||||
}
|
||||
-- whenIsJust ((,) <$> appStudyFeaturesRecacheRelevanceWithin <*> appJobCronInterval) $ \(within, cInterval) -> do
|
||||
-- nextIntervals <- getNextIntervals within appStudyFeaturesRecacheRelevanceInterval cInterval
|
||||
-- forM_ nextIntervals $ \(nextEpoch, nextInterval, nextIntervalTime, numIntervals) -> do
|
||||
-- tell $ HashMap.singleton
|
||||
-- (JobCtlQueue JobStudyFeaturesRecacheRelevance
|
||||
-- { jEpoch = fromInteger nextEpoch
|
||||
-- , jNumIterations = fromInteger numIntervals
|
||||
-- , jIteration = fromInteger nextInterval
|
||||
-- }
|
||||
-- )
|
||||
-- Cron
|
||||
-- { cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ toTimeOfDay 22 0 0 $ utctDay nextIntervalTime
|
||||
-- , cronRepeat = CronRepeatNever
|
||||
-- , cronRateLimit = appStudyFeaturesRecacheRelevanceInterval
|
||||
-- , cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appStudyFeaturesRecacheRelevanceInterval nextIntervalTime
|
||||
-- }
|
||||
|
||||
whenIsJust appQualificationCheckHour $ \hour -> tell $ HashMap.singleton
|
||||
(JobCtlQueue JobLmsQualificationsEnqueue)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user