fix(avs): attempt to fix avs background jobs
This commit is contained in:
parent
55d2dfcef3
commit
bbaa42eefa
@ -222,6 +222,8 @@ postAdminTestR = do
|
|||||||
usrCryptoFileName <- maybeM (return "no-user_id") (fmap toPathPiece . mkCryptoFilnameUser) maybeAuthId
|
usrCryptoFileName <- maybeM (return "no-user_id") (fmap toPathPiece . mkCryptoFilnameUser) maybeAuthId
|
||||||
usrCryptoUUID <- maybeM (return "no-user_id") (fmap toPathPiece . mkCryptoUUIDUser) maybeAuthId
|
usrCryptoUUID <- maybeM (return "no-user_id") (fmap toPathPiece . mkCryptoUUIDUser) maybeAuthId
|
||||||
|
|
||||||
|
UniWorX{ appSettings' = AppSettings{..} } <- getYesod
|
||||||
|
|
||||||
let locallyDefinedPageHeading = [whamlet|Admin TestPage for Uni2work|]
|
let locallyDefinedPageHeading = [whamlet|Admin TestPage for Uni2work|]
|
||||||
siteLayout locallyDefinedPageHeading $ do
|
siteLayout locallyDefinedPageHeading $ do
|
||||||
-- defaultLayout $ do
|
-- defaultLayout $ do
|
||||||
@ -311,6 +313,18 @@ postAdminTestR = do
|
|||||||
|]
|
|]
|
||||||
i18n $ MsgPrintDebugForStupid "DebugForStupid"
|
i18n $ MsgPrintDebugForStupid "DebugForStupid"
|
||||||
|
|
||||||
|
[whamlet|
|
||||||
|
<section>
|
||||||
|
<h2> Some Active App Settings
|
||||||
|
<dl .deflist>
|
||||||
|
<dt .deflist__dt> appJobCronInterval
|
||||||
|
<dd .deflist__dd>#{tshow appJobCronInterval}
|
||||||
|
<dt .deflist__dt> appSynchroniseLdapUsersWithin
|
||||||
|
<dd .deflist__dd>#{tshow appSynchroniseLdapUsersWithin}
|
||||||
|
<dt .deflist__dt> appSynchroniseAvsUsersWithin
|
||||||
|
<dd .deflist__dd>#{tshow appSynchroniseAvsUsersWithin}
|
||||||
|
|]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -338,6 +338,7 @@ determineCrontab = execWriterT $ do
|
|||||||
, Just cInterval <- appJobCronInterval
|
, Just cInterval <- appJobCronInterval
|
||||||
-> do
|
-> do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
|
let nowaday = utctDay now
|
||||||
nextIntervals <- getNextIntervals syncWithin appSynchroniseAvsUsersInterval cInterval
|
nextIntervals <- getNextIntervals syncWithin appSynchroniseAvsUsersInterval cInterval
|
||||||
|
|
||||||
forM_ nextIntervals $ \(nextEpoch, nextInterval, nextIntervalTime, numIntervals) -> do
|
forM_ nextIntervals $ \(nextEpoch, nextInterval, nextIntervalTime, numIntervals) -> do
|
||||||
@ -346,7 +347,7 @@ determineCrontab = execWriterT $ do
|
|||||||
{ jEpoch = fromInteger nextEpoch
|
{ jEpoch = fromInteger nextEpoch
|
||||||
, jNumIterations = fromInteger numIntervals
|
, jNumIterations = fromInteger numIntervals
|
||||||
, jIteration = fromInteger nextInterval
|
, jIteration = fromInteger nextInterval
|
||||||
, jSynchAfter = Just $ addWeeks (-1) now -- at most once per week
|
, jSynchAfter = Just $ toMidnight $ addDays (-7) nowaday -- at most once per week
|
||||||
})
|
})
|
||||||
Cron
|
Cron
|
||||||
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ $ toTimeOfDay 22 0 0 $ utctDay nextIntervalTime
|
{ cronInitial = CronTimestamp $ utcToLocalTimeTZ appTZ $ toTimeOfDay 22 0 0 $ utctDay nextIntervalTime
|
||||||
|
|||||||
@ -336,7 +336,7 @@ jobNoQueueSame = \case
|
|||||||
JobPruneInvitations{} -> Just JobNoQueueSame
|
JobPruneInvitations{} -> Just JobNoQueueSame
|
||||||
JobDeleteTransactionLogIPs{} -> Just JobNoQueueSame
|
JobDeleteTransactionLogIPs{} -> Just JobNoQueueSame
|
||||||
JobSynchroniseLdapUser{} -> Just JobNoQueueSame
|
JobSynchroniseLdapUser{} -> Just JobNoQueueSame
|
||||||
JobSynchroniseAvsUser{} -> Just JobNoQueueSame
|
JobSynchroniseAvsUser{} -> Just JobNoQueueSameTag
|
||||||
JobSynchroniseAvsId{} -> Just JobNoQueueSame
|
JobSynchroniseAvsId{} -> Just JobNoQueueSame
|
||||||
JobChangeUserDisplayEmail{} -> Just JobNoQueueSame
|
JobChangeUserDisplayEmail{} -> Just JobNoQueueSame
|
||||||
JobPruneSessionFiles{} -> Just JobNoQueueSameTag
|
JobPruneSessionFiles{} -> Just JobNoQueueSameTag
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user