diff options
Diffstat (limited to 'web/job')
| -rw-r--r-- | web/job/ldap_sync_job.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/web/job/ldap_sync_job.go b/web/job/ldap_sync_job.go index a947eb73..7edb8178 100644 --- a/web/job/ldap_sync_job.go +++ b/web/job/ldap_sync_job.go @@ -271,10 +271,7 @@ func (j *LdapSyncJob) deleteClientsNotInLDAP(inboundTag string, ldapEmails map[s // Delete in batches for i := 0; i < len(toDelete); i += batchSize { - end := i + batchSize - if end > len(toDelete) { - end = len(toDelete) - } + end := min(i+batchSize, len(toDelete)) batch := toDelete[i:end] for _, c := range batch { |
