Skip to content

Commit 04820e4

Browse files
Merge pull request #1789 from atlassian/jira-fix-deployment-type-analytics
added retry to get system info page
2 parents 79c9735 + 8a6ef2a commit 04820e4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/util/api/jira_clients.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
22
import string
3+
import time
4+
35
from selenium.common.exceptions import WebDriverException
46

57
from util.api.abstract_clients import RestClient
@@ -224,8 +226,14 @@ def get_system_info_page(self):
224226
else:
225227
self.post(login_url, error_msg='Could not login in')
226228
auth_body['atl_token'] = self.session.cookies.get_dict()['atlassian.xsrf.token']
227-
system_info_html = self.session.post(auth_url, data=auth_body, headers={'X-Atlassian-Token': 'no-check'}, verify=self.verify)
228-
return system_info_html.content.decode("utf-8")
229+
number_of_attempts = 5
230+
for _ in range(0, number_of_attempts):
231+
system_info_html = self.session.post(auth_url, data=auth_body, headers={'X-Atlassian-Token': 'no-check'}, verify=self.verify)
232+
if system_info_html.status_code == 200:
233+
return system_info_html.content.decode("utf-8")
234+
time.sleep(1)
235+
print(f"ERROR: Could not get the system information page.")
236+
return ""
229237

230238
def get_available_processors(self):
231239
try:

0 commit comments

Comments
 (0)