fix(interval jobs): avoid accumulation, reduce job size

This commit is contained in:
Gregor Kleen 2021-08-13 11:38:57 +02:00
parent 839b5437ea
commit 24491b446b
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ bearer-expiration: 604800
bearer-encoding: HS256 bearer-encoding: HS256
maximum-content-length: "_env:MAX_UPLOAD_SIZE:805306368" maximum-content-length: "_env:MAX_UPLOAD_SIZE:805306368"
session-files-expire: 3600 session-files-expire: 3600
prune-unreferenced-files-within: 57600 prune-unreferenced-files-within: 604801
prune-unreferenced-files-interval: 3600 prune-unreferenced-files-interval: 3600
keep-unreferenced-files: 86400 keep-unreferenced-files: 86400
health-check-interval: health-check-interval:

View File

@ -322,7 +322,7 @@ determineCrontab = execWriterT $ do
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime { cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
, cronRepeat = CronRepeatNever , cronRepeat = CronRepeatNever
, cronRateLimit = appSynchroniseLdapUsersInterval , cronRateLimit = appSynchroniseLdapUsersInterval
, cronNotAfter = Left syncWithin , cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appSynchroniseLdapUsersInterval nextIntervalTime
} }
| otherwise | otherwise
-> return () -> return ()
@ -341,7 +341,7 @@ determineCrontab = execWriterT $ do
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime { cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
, cronRepeat = CronRepeatNever , cronRepeat = CronRepeatNever
, cronRateLimit = appPruneUnreferencedFilesInterval , cronRateLimit = appPruneUnreferencedFilesInterval
, cronNotAfter = Left within , cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appPruneUnreferencedFilesInterval nextIntervalTime
} }
whenIsJust ((,) <$> appStudyFeaturesRecacheRelevanceWithin <*> appJobCronInterval) $ \(within, cInterval) -> do whenIsJust ((,) <$> appStudyFeaturesRecacheRelevanceWithin <*> appJobCronInterval) $ \(within, cInterval) -> do
@ -358,7 +358,7 @@ determineCrontab = execWriterT $ do
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime { cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ nextIntervalTime
, cronRepeat = CronRepeatNever , cronRepeat = CronRepeatNever
, cronRateLimit = appStudyFeaturesRecacheRelevanceInterval , cronRateLimit = appStudyFeaturesRecacheRelevanceInterval
, cronNotAfter = Left within , cronNotAfter = Right . CronTimestamp . utcToLocalTimeTZ appTZ $ addUTCTime appStudyFeaturesRecacheRelevanceInterval nextIntervalTime
} }
let let