Skip to content

Commit

Permalink
setup rpm calc outside the job, so if it fails, it fails early and do…
Browse files Browse the repository at this point in the history
…esn't take down the job
  • Loading branch information
CamDavidsonPilon committed May 21, 2024
1 parent 9477294 commit 7c11bb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pioreactor/background_jobs/stirring.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ def __init__(

if self.rpm_calculator is not None:
self.logger.debug("Operating with RPM feedback loop.")
self.rpm_calculator.setup()
else:
self.logger.debug("Operating without RPM feedback loop.")

Expand Down Expand Up @@ -484,8 +483,10 @@ def start_stirring(

if use_rpm and not is_testing_env():
rpm_calculator = RpmFromFrequency()
rpm_calculator.setup()
elif use_rpm and is_testing_env():
rpm_calculator = MockRpmCalculator() # type: ignore
rpm_calculator.setup()
else:
rpm_calculator = None

Expand Down

0 comments on commit 7c11bb5

Please sign in to comment.