initialize object layer right after config has loaded

This commit is contained in:
Harshavardhana
2020-10-19 22:04:59 -07:00
parent b07df5cae1
commit d6d770c1b1
2 changed files with 7 additions and 7 deletions

View File

@@ -330,6 +330,11 @@ func initAllSubsystems(ctx context.Context, newObject ObjectLayer) (err error) {
logger.LogIf(ctx, fmt.Errorf("Unable to initialize config, some features may be missing %w", err))
}
// Once the config is fully loaded, initialize the new object layer.
globalObjLayerMutex.Lock()
globalObjectAPI = newObject
globalObjLayerMutex.Unlock()
// Initialize IAM store
globalIAMSys.InitStore(newObject)
@@ -501,11 +506,6 @@ func serverMain(ctx *cli.Context) {
}
}
// Once the config is fully loaded, initialize the new object layer.
globalObjLayerMutex.Lock()
globalObjectAPI = newObject
globalObjLayerMutex.Unlock()
// Initialize users credentials and policies in background right after config has initialized.
go globalIAMSys.Init(GlobalContext, newObject)