config: allow setting directory sync interval and timeout (#1098)

Updates #567
This commit is contained in:
Cuong Manh Le 2020-07-17 23:11:27 +07:00 committed by GitHub
parent 25867501d4
commit 821f2e9000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 4 deletions

View file

@ -188,7 +188,7 @@ func (mgr *Manager) refreshLoop(
func (mgr *Manager) refreshDirectoryUsers(ctx context.Context) {
mgr.log.Info().Msg("refreshing directory users")
ctx, clearTimeout := context.WithTimeout(ctx, time.Minute)
ctx, clearTimeout := context.WithTimeout(ctx, mgr.cfg.groupRefreshTimeout)
defer clearTimeout()
directoryUsers, err := mgr.directory.UserGroups(ctx)