Skip to content

Commit 016a484

Browse files
committed
try 5 times to get status before failing
1 parent 5d8f262 commit 016a484

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

chipflow_lib/steps/silicon.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def submit(self, rtlil_path, *, dry_run=False, wait=False):
199199

200200
# Poll the status API until the build is completed or failed
201201
stream_event_counter = 0
202+
fail_counter = 0
202203
if wait:
203204
while True:
204205
logger.info("Polling build status...")
@@ -207,8 +208,11 @@ def submit(self, rtlil_path, *, dry_run=False, wait=False):
207208
auth=(None, chipflow_api_key)
208209
)
209210
if status_resp.status_code != 200:
210-
logger.error(f"Failed to fetch build status: {status_resp.text}")
211-
raise ChipFlowError("Error while checking build status.")
211+
fail_counter += 1
212+
logger.error(f"Failed to fetch build status {fail_counter} times: {status_resp.text}")
213+
if fail_counter > 5:
214+
logger.error(f"Failed to fetch build status {fail_counter} times. Exiting.")
215+
raise ChipFlowError("Error while checking build status.")
212216

213217
status_data = status_resp.json()
214218
build_status = status_data.get("status")

0 commit comments

Comments
 (0)