Skip to content

Commit

Permalink
Wait for gitlab export based on export_status, reset retries when git…
Browse files Browse the repository at this point in the history
…lab is processing the request
  • Loading branch information
wiro committed Mar 25, 2020
1 parent 336444a commit 346981d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def project_export(self, project_path):
r = self.__api_export(url_project_path)
if ((float(r.status_code) >= 200) and (float(r.status_code) < 300)):
# Api good, check for status
max_tries = 30
max_tries_number = 10
max_tries = max_tries_number
s = ""
status_export = False
while max_tries != 0:
Expand All @@ -145,6 +146,10 @@ def project_export(self, project_path):
if s == "finished" and "_links" in json.keys():
status_export = True
break

if s == "queued" or s == "finished" or s == "started" or s == "regeneration_in_progress":
# Reset counter, we are waiting for export
max_tries = max_tries_number
else:
s = "unknown"

Expand Down

0 comments on commit 346981d

Please sign in to comment.