Skip to content

Commit db3eb70

Browse files
committed
A bit of cleanup.
1 parent 4a2fcb3 commit db3eb70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

databases/kbase/user_federation.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ func startUserFederation() error {
6565
t := time.Now()
6666
topOfHour := time.Date(t.Year(), t.Month(), t.Day(), t.Hour()+1, 0, 0, 0, t.Location())
6767
time.Sleep(time.Until(topOfHour))
68-
kbaseUpdateChan <- struct{}{}
68+
err := reloadUserTable()
6969

7070
// reloading errors are logged, not propagated
71-
err := <-kbaseErrorChan
7271
if err != nil {
7372
slog.Warn(err.Error())
7473
}
@@ -89,6 +88,11 @@ func usernameForOrcid(orcid string) (string, error) {
8988
return username, err
9089
}
9190

91+
func reloadUserTable() error {
92+
kbaseUpdateChan <- struct{}{}
93+
return <-kbaseErrorChan
94+
}
95+
9296
// stops the user federation machinery
9397
func stopUserFederation() error {
9498
if !kbaseUserFederationStarted {

0 commit comments

Comments
 (0)