Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ func (sys *IAMSys) periodicRoutines(ctx context.Context, baseInterval time.Durat
timer := time.NewTimer(waitInterval())
defer timer.Stop()

lastPurgeHour := -1
for {
select {
case <-timer.C:
Expand All @@ -421,9 +422,9 @@ func (sys *IAMSys) periodicRoutines(ctx context.Context, baseInterval time.Durat
}
}

// The following actions are performed about once in 4 times that
// IAM is refreshed:
if r.Intn(4) == 0 {
// Run purge routines once in each hour.
if refreshStart.Hour() != lastPurgeHour {
lastPurgeHour = refreshStart.Hour()
// Poll and remove accounts for those users who were removed
// from LDAP/OpenID.
if sys.LDAPConfig.Enabled() {
Expand Down
Loading