mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
Increase HTTP timeout for Keycloak and meassure totalUsersCount call
This commit is contained in:
@@ -62,7 +62,7 @@ func NewKeycloakManager(config KeycloakClientConfig, appMetrics telemetry.AppMet
|
|||||||
httpTransport.MaxIdleConns = 5
|
httpTransport.MaxIdleConns = 5
|
||||||
|
|
||||||
httpClient := &http.Client{
|
httpClient := &http.Client{
|
||||||
Timeout: 10 * time.Second,
|
Timeout: 60 * time.Second,
|
||||||
Transport: httpTransport,
|
Transport: httpTransport,
|
||||||
}
|
}
|
||||||
helper := JsonParser{}
|
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.
|
// totalUsersCount returns the total count of all user created.
|
||||||
// Used when fetching all registered accounts with pagination.
|
// Used when fetching all registered accounts with pagination.
|
||||||
func (km *KeycloakManager) totalUsersCount() (*int, error) {
|
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)
|
body, err := km.get("users/count", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user