chore(avs): make backround avs updates more robust
This commit is contained in:
parent
cc465fad16
commit
7e7bd993a1
@ -91,8 +91,9 @@ BtnResetTokens: Authorisierungs-Tokens invalidieren
|
|||||||
|
|
||||||
TokensLastReset: Tokens zuletzt invalidiert
|
TokensLastReset: Tokens zuletzt invalidiert
|
||||||
ProfileNever: Nie
|
ProfileNever: Nie
|
||||||
ProfileLastLdapSynchronisation: Letzte LDAP-Synchronisation
|
|
||||||
ProfileLdapPrimaryKey: LDAP-Primärschlüssel
|
ProfileLdapPrimaryKey: LDAP-Primärschlüssel
|
||||||
|
ProfileLastLdapSynchronisation: Letzte LDAP-Synchronisation
|
||||||
|
ProfileLastAvsSynchronisation: Letzte AVS-Synchronisation
|
||||||
|
|
||||||
NotificationSettingsUpdate: Benachrichtigungs-Einstellungen erfolgreich gespeichert
|
NotificationSettingsUpdate: Benachrichtigungs-Einstellungen erfolgreich gespeichert
|
||||||
NotificationSettingsHeading displayName@Text: Benachrichtigungs-Einstellungen für #{displayName}
|
NotificationSettingsHeading displayName@Text: Benachrichtigungs-Einstellungen für #{displayName}
|
||||||
|
|||||||
@ -91,8 +91,9 @@ BtnResetTokens: Invalidate tokens
|
|||||||
|
|
||||||
TokensLastReset: Tokens last reset
|
TokensLastReset: Tokens last reset
|
||||||
ProfileNever: Never
|
ProfileNever: Never
|
||||||
ProfileLastLdapSynchronisation: Last LDAP synchronisation
|
|
||||||
ProfileLdapPrimaryKey: LDAP primary key
|
ProfileLdapPrimaryKey: LDAP primary key
|
||||||
|
ProfileLastLdapSynchronisation: Last LDAP synchronisation
|
||||||
|
ProfileLastAvsSynchronisation: Last AVS synchronisation
|
||||||
|
|
||||||
NotificationSettingsUpdate: Successfully updated notification settings
|
NotificationSettingsUpdate: Successfully updated notification settings
|
||||||
NotificationSettingsHeading displayName: Notification settings for #{displayName}
|
NotificationSettingsHeading displayName: Notification settings for #{displayName}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import Jobs.Queue
|
|||||||
|
|
||||||
import Handler.Utils.Avs
|
import Handler.Utils.Avs
|
||||||
|
|
||||||
-- TODO: JobSynchroniseAllAvs is not yet scheduled in Crontab
|
|
||||||
dispatchJobSynchroniseAvs :: Natural -> Natural -> Natural -> Maybe UTCTime -> JobHandler UniWorX
|
dispatchJobSynchroniseAvs :: Natural -> Natural -> Natural -> Maybe UTCTime -> JobHandler UniWorX
|
||||||
dispatchJobSynchroniseAvs numIterations epoch iteration pause
|
dispatchJobSynchroniseAvs numIterations epoch iteration pause
|
||||||
= JobHandlerAtomic . runConduit $
|
= JobHandlerAtomic . runConduit $
|
||||||
@ -43,7 +42,12 @@ workJobSynchroniseAvs eauid pause = JobHandlerException $ do
|
|||||||
Nothing -> return () -- do not create new newers in this background job, only update existing
|
Nothing -> return () -- do not create new newers in this background job, only update existing
|
||||||
Just Entity{entityVal=UserAvs{..}}
|
Just Entity{entityVal=UserAvs{..}}
|
||||||
| maybe False (userAvsLastSynch >=) pause -> return () -- we just updated this one within the given limit
|
| maybe False (userAvsLastSynch >=) pause -> return () -- we just updated this one within the given limit
|
||||||
| otherwise -> void $ upsertAvsUserById userAvsPersonId -- updates UserAvsLAstSynch
|
| otherwise -> catch (void $ upsertAvsUserById userAvsPersonId) -- updates UserAvsLastSynch
|
||||||
|
(\case
|
||||||
|
AvsInterfaceUnavailable -> return () -- ignore and retry later
|
||||||
|
AvsUserUnknownByAvs _ -> return () -- ignore for users no longer listed in AVS
|
||||||
|
otherExc -> throwM otherExc
|
||||||
|
)
|
||||||
|
|
||||||
dispatchJobSynchroniseAvsId :: AvsPersonId -> Maybe UTCTime -> JobHandler UniWorX
|
dispatchJobSynchroniseAvsId :: AvsPersonId -> Maybe UTCTime -> JobHandler UniWorX
|
||||||
dispatchJobSynchroniseAvsId = workJobSynchroniseAvs . Left
|
dispatchJobSynchroniseAvsId = workJobSynchroniseAvs . Left
|
||||||
|
|||||||
@ -18,8 +18,12 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgAvsPersonNo}
|
_{MsgAvsPersonNo}
|
||||||
^{messageTooltip tooltipAvsPersNo}
|
^{messageTooltip tooltipAvsPersNo}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd .ldap-primary-key>
|
||||||
#{view _userAvsNoPerson avs}
|
#{view _userAvsNoPerson avs}
|
||||||
|
<dt .deflist__dt>
|
||||||
|
_{MsgProfileLastAvsSynchronisation}
|
||||||
|
<dd .deflist__dd>
|
||||||
|
^{formatTimeW SelFormatDateTime (view _userAvsLastSynch avs)}
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgNameSet}
|
_{MsgNameSet}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
|
|||||||
Reference in New Issue
Block a user