mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 10:21:10 +01:00
Increase HTTP timeout for Keycloak and meassure totalUsersCount call
This commit is contained in:
parent
f73a2e2848
commit
52e86cabc3
@ -62,7 +62,7 @@ func NewKeycloakManager(config KeycloakClientConfig, appMetrics telemetry.AppMet
|
||||
httpTransport.MaxIdleConns = 5
|
||||
|
||||
httpClient := &http.Client{
|
||||
Timeout: 10 * time.Second,
|
||||
Timeout: 60 * time.Second,
|
||||
Transport: httpTransport,
|
||||
}
|
||||
helper := JsonParser{}
|
||||
@ -415,6 +415,11 @@ func (km *KeycloakManager) get(resource string, q url.Values) ([]byte, error) {
|
||||
// totalUsersCount returns the total count of all user created.
|
||||
// Used when fetching all registered accounts with pagination.
|
||||
func (km *KeycloakManager) totalUsersCount() (*int, error) {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
log.Debugf("Keycloak totalUsersCount took %d ms to handle", time.Since(start).Milliseconds())
|
||||
}()
|
||||
|
||||
body, err := km.get("users/count", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user