mirror of
https://github.com/minio/minio.git
synced 2025-11-08 05:04:55 -05:00
start watcher after all creds have been loaded (#9301)
start watcher after all creds have been loaded to avoid any conflicting locks that might get deadlocked. Deprecate unused peer calls for LoadUsers()
This commit is contained in:
@@ -590,17 +590,13 @@ func listIAMConfigItems(ctx context.Context, objAPI ObjectLayer, pathPrefix stri
|
||||
}
|
||||
|
||||
func (iamOS *IAMObjectStore) watch(ctx context.Context, sys *IAMSys) {
|
||||
watchDisk := func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.NewTimer(globalRefreshIAMInterval).C:
|
||||
logger.LogIf(ctx, iamOS.loadAll(ctx, sys))
|
||||
}
|
||||
// Refresh IAMSys.
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.NewTimer(globalRefreshIAMInterval).C:
|
||||
logger.LogIf(ctx, iamOS.loadAll(ctx, sys))
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh IAMSys in background.
|
||||
go watchDisk()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user