From 7c11bb57463ed2a8b131e97f20f2eead4b461cec Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Tue, 21 May 2024 16:51:14 -0400 Subject: [PATCH] setup rpm calc outside the job, so if it fails, it fails early and doesn't take down the job --- pioreactor/background_jobs/stirring.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pioreactor/background_jobs/stirring.py b/pioreactor/background_jobs/stirring.py index d3a5a807..861dcd1b 100644 --- a/pioreactor/background_jobs/stirring.py +++ b/pioreactor/background_jobs/stirring.py @@ -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.") @@ -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