Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Nov 29, 2024
1 parent 9b7099c commit 94f5d62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pioreactor/background_jobs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions pioreactor/background_jobs/stirring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94f5d62

Please sign in to comment.