Avoid calling the user count query in future if we get a count > 0 (#23545)
* Avoid calling the user count query in future if we get a count > 0 * re-adding mock session to avoid adding the old mitigation in future * adjustments based on feedback
Этот коммит содержится в:
@@ -49,10 +49,11 @@ type PlatformService struct {
|
||||
sessionCache cache.Cache
|
||||
sessionPool sync.Pool
|
||||
|
||||
asymmetricSigningKey atomic.Value
|
||||
clientConfig atomic.Value
|
||||
clientConfigHash atomic.Value
|
||||
limitedClientConfig atomic.Value
|
||||
asymmetricSigningKey atomic.Value
|
||||
clientConfig atomic.Value
|
||||
clientConfigHash atomic.Value
|
||||
limitedClientConfig atomic.Value
|
||||
fetchUserCountForFirstUserAccountCheck atomic.Bool
|
||||
|
||||
logger *mlog.Logger
|
||||
notificationsLogger *mlog.Logger
|
||||
@@ -126,6 +127,9 @@ func New(sc ServiceConfig, options ...Option) (*PlatformService, error) {
|
||||
additionalClusterHandlers: map[model.ClusterEvent]einterfaces.ClusterMessageHandler{},
|
||||
}
|
||||
|
||||
// Assume the first user account has not been created yet. A call to the DB will later check if this is really the case.
|
||||
ps.fetchUserCountForFirstUserAccountCheck.Store(true)
|
||||
|
||||
// Step 1: Cache provider.
|
||||
// At the moment we only have this implementation
|
||||
// in the future the cache provider will be built based on the loaded config
|
||||
|
||||
Ссылка в новой задаче
Block a user