Skip to content

Commit

Permalink
extend registries APIs timeouts
Browse files Browse the repository at this point in the history
Signed-off-by: refaelm <[email protected]>
  • Loading branch information
refaelm92 committed Dec 15, 2024
1 parent 46839de commit ce8b6dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions infrastructure/backend_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2185,15 +2185,15 @@ def remove_alert_channel(self, guid) -> requests.Response:
return res

def check_registry(self, payload, provider) -> requests.Response:
res = self.post(API_REGISTRY_MANAGEMENT + "/" + provider + "/repositories", cookies=self.selected_tenant_cookie, data=json.dumps(payload))
res = self.post(API_REGISTRY_MANAGEMENT + "/" + provider + "/repositories", cookies=self.selected_tenant_cookie, data=json.dumps(payload), timeout=60)
if not 200 <= res.status_code < 300:
raise Exception(
'Error accessing dashboard. Request: check registry "%s" (code: %d, message: %s)' % (
self.customer, res.status_code, res.text))
return res

def create_registry(self, payload, provider) -> requests.Response:
res = self.post(API_REGISTRY_MANAGEMENT + "/" + provider, cookies=self.selected_tenant_cookie, data=json.dumps(payload))
res = self.post(API_REGISTRY_MANAGEMENT + "/" + provider, cookies=self.selected_tenant_cookie, data=json.dumps(payload), timeout=60)
if not 200 <= res.status_code < 300:
raise Exception(
'Error accessing dashboard. Request: create registry "%s" (code: %d, message: %s)' % (
Expand All @@ -2217,7 +2217,7 @@ def get_all_registries(self, provider) -> requests.Response:
return res

def update_registry(self, payload, provider, guid) -> requests.Response:
res = self.put(API_REGISTRY_MANAGEMENT + "/" + provider + "/" + guid, cookies=self.selected_tenant_cookie, data=json.dumps(payload))
res = self.put(API_REGISTRY_MANAGEMENT + "/" + provider + "/" + guid, cookies=self.selected_tenant_cookie, data=json.dumps(payload), timeout=60)
if not 200 <= res.status_code < 300:
raise Exception(
'Error accessing dashboard. Request: update registry "%s" (code: %d, message: %s)' % (
Expand Down

0 comments on commit ce8b6dc

Please sign in to comment.