Skip to content

Commit

Permalink
Fixes #97
Browse files Browse the repository at this point in the history
  • Loading branch information
tetov committed Nov 10, 2020
1 parent 2d13d3f commit aca64ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rapid_clay_formations_fab/robots/_scripts/fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from typing import List
from typing import Optional
from typing import Tuple
import sys

import compas_rrc
import confuse
Expand Down Expand Up @@ -85,9 +86,13 @@ def fabrication(run_conf: confuse.AttrDict, run_data: dict) -> None:
prev_elem.cycle_time = _wait_and_return_future(
prev_elem.cycle_time_future
)
if not prev_elem.cycle_time:

# TODO: Move sysexit to _wait_and_return_future here?
if not prev_elem.cycle_time: # If KeyboardInterrupt was raised
log.info("Exiting script, breaking loop and saving run_data.")
break
_write_run_data(progress_file, run_data, fab_elements)
sys.exit(0)

cycle_time_msg = f"Last cycle time was: {prev_elem.cycle_time:0.0f}"
log.info(cycle_time_msg)
rob_client.send(PrintTextNoErase(cycle_time_msg))
Expand Down

0 comments on commit aca64ff

Please sign in to comment.