purge folder is submit is ok

This commit is contained in:
François Patron 2024-12-20 15:24:48 +01:00
parent 9d596f738c
commit 1f427214f0

View File

@ -123,9 +123,11 @@ def send_results(session, master_ip, master_port, tig_worker_path, download_wasm
resp = session.post(submit_url, json=result)
if resp.status_code == 200:
FINISHED_BATCH_IDS[batch_id] = now()
purge_folders(output_path, 0)
logger.info(f"successfully posted root for batch {batch_id}")
elif resp.status_code == 408: # took too long
FINISHED_BATCH_IDS[batch_id] = now()
purge_folders(output_path, 0)
logger.error(f"status {resp.status_code} when posting root for batch {batch_id} to master: {resp.text}")
else:
logger.error(f"status {resp.status_code} when posting root for batch {batch_id} to master: {resp.text}")
@ -163,9 +165,11 @@ def send_results(session, master_ip, master_port, tig_worker_path, download_wasm
resp = session.post(submit_url, json=payload)
if resp.status_code == 200:
FINISHED_BATCH_IDS[batch_id] = now()
purge_folders(output_path, 0)
logger.info(f"successfully posted proofs for batch {batch_id}")
elif resp.status_code == 408: # took too long
FINISHED_BATCH_IDS[batch_id] = now()
purge_folders(output_path, 0)
logger.error(f"status {resp.status_code} when posting proofs for batch {batch_id} to master: {resp.text}")
else:
logger.error(f"status {resp.status_code} when posting proofs for batch {batch_id} to master: {resp.text}")