diff --git a/gateway/main.go b/gateway/main.go index 19477285..c290cc41 100644 --- a/gateway/main.go +++ b/gateway/main.go @@ -137,7 +137,7 @@ func main() { scalingConfig := scaling.ScalingConfig{ MaxPollCount: uint(1000), SetScaleRetries: uint(20), - FunctionPollInterval: time.Millisecond * 50, + FunctionPollInterval: time.Millisecond * 100, CacheExpiry: time.Second * 5, // freshness of replica values before going stale ServiceQuery: externalServiceQuery, } diff --git a/gateway/plugin/external.go b/gateway/plugin/external.go index c75e6bfc..3ab61f90 100644 --- a/gateway/plugin/external.go +++ b/gateway/plugin/external.go @@ -63,14 +63,16 @@ func (s ExternalServiceQuery) GetReplicas(serviceName, serviceNamespace string) urlPath := fmt.Sprintf("%ssystem/function/%s?namespace=%s", s.URL.String(), serviceName, serviceNamespace) - req, _ := http.NewRequest(http.MethodGet, urlPath, nil) + req, err := http.NewRequest(http.MethodGet, urlPath, nil) + if err != nil { + return emptyServiceQueryResponse, err + } if s.AuthInjector != nil { s.AuthInjector.Inject(req) } res, err := s.ProxyClient.Do(req) - if err != nil { log.Println(urlPath, err) } else {