diff --git a/pioreactor/background_jobs/base.py b/pioreactor/background_jobs/base.py index d7859dea..af23d3b2 100644 --- a/pioreactor/background_jobs/base.py +++ b/pioreactor/background_jobs/base.py @@ -26,6 +26,7 @@ from pioreactor.utils import append_signal_handlers from pioreactor.utils import is_pio_job_running from pioreactor.utils import JobManager +from pioreactor.utils.timing import catchtime from pioreactor.utils.timing import RepeatedTimer from pioreactor.whoami import is_active from pioreactor.whoami import is_testing_env @@ -1125,8 +1126,9 @@ def sneak_in(ads_interval, post_delay, pre_delay) -> None: if self.state != self.READY: return - self._action_to_do_after_od_reading() - sleep(ads_interval - self.OD_READING_DURATION - (post_delay + pre_delay)) + with catchtime() as timer: + self._action_to_do_after_od_reading() + sleep(ads_interval - self.OD_READING_DURATION - (post_delay + pre_delay) - timer()) self._action_to_do_before_od_reading() # this could fail in the following way: diff --git a/pioreactor/background_jobs/stirring.py b/pioreactor/background_jobs/stirring.py index e02e9447..196bf25b 100644 --- a/pioreactor/background_jobs/stirring.py +++ b/pioreactor/background_jobs/stirring.py @@ -283,10 +283,8 @@ def __init__( def action_to_do_before_od_reading(self): self.set_duty_cycle(0) - self.logger.debug("stop stirring") def action_to_do_after_od_reading(self): - self.logger.debug("starting stirring") self.start_stirring() sleep(1) self.poll_and_update_dc(2)