From 5a503d9a3cc08d4731593eaee2fe4f34228496d2 Mon Sep 17 00:00:00 2001 From: Doug Boulware Date: Mon, 13 May 2024 09:57:21 -0400 Subject: [PATCH] Move logging statement of retry in healthy method into else to only log when it will retry. --- scos_actions/hardware/sigan_iface.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scos_actions/hardware/sigan_iface.py b/scos_actions/hardware/sigan_iface.py index 3cf339bb..23497414 100644 --- a/scos_actions/hardware/sigan_iface.py +++ b/scos_actions/hardware/sigan_iface.py @@ -83,14 +83,15 @@ def healthy(self, num_samples: int = 56000, retries: int = 3) -> bool: break except BaseException as e: retries -= 1 - logger.debug( - "Unable to acquire samples during health check. Retrying..." - ) if retries == 0: logger.exception( "Unable to acquire samples from device during health check." ) return False + else: + logger.debug( + "Unable to acquire samples during health check. Retrying..." + ) if not len(data) == num_samples: logger.error("Data length doesn't match request.")