[management] Add buffering for getAccount requests during login (#2449)

This commit is contained in:
pascal-fischer
2024-08-20 20:06:01 +02:00
committed by GitHub
parent 8c2d37d3fc
commit 3ed90728e6
4 changed files with 329 additions and 6 deletions

View File

@@ -161,6 +161,8 @@ type DefaultAccountManager struct {
eventStore activity.Store
geo *geolocation.Geolocation
cache *AccountCache
// singleAccountMode indicates whether the instance has a single account.
// If true, then every new user will end up under the same account.
// This value will be set to false if management service has more than one account.
@@ -967,6 +969,7 @@ func BuildManager(
userDeleteFromIDPEnabled: userDeleteFromIDPEnabled,
integratedPeerValidator: integratedPeerValidator,
metrics: metrics,
cache: NewAccountCache(ctx, store),
}
allAccounts := store.GetAllAccounts(ctx)
// enable single account mode only if configured by user and number of existing accounts is not grater than 1