diff --git a/src/panoptes/pocs/utils/service/power.py b/src/panoptes/pocs/utils/service/power.py index 26b29a192..2bfe0d26f 100644 --- a/src/panoptes/pocs/utils/service/power.py +++ b/src/panoptes/pocs/utils/service/power.py @@ -44,7 +44,10 @@ def record_readings(): power_board.logger.info(f'Setting up power recording {record_interval=}') while True: time.sleep(record_interval) - power_board.record(collection_name='power') + try: + power_board.record(collection_name='power') + except Exception as e: + power_board.logger.warning(f'Could not get power record: {e}') # Create a thread to record the readings at an interval. power_thread = Thread(target=record_readings) diff --git a/src/panoptes/pocs/utils/service/weather.py b/src/panoptes/pocs/utils/service/weather.py index c25c8a8e2..bccb90cf1 100644 --- a/src/panoptes/pocs/utils/service/weather.py +++ b/src/panoptes/pocs/utils/service/weather.py @@ -54,7 +54,10 @@ def record_readings(): weather_station.logger.info(f'Setting up weather recording {record_interval=}') while True: time.sleep(record_interval) - weather_station.record() + try: + weather_station.record() + except Exception as e: + weather_station.logger.warning(f'Could not get weather record: {e}') # Create a thread to record the readings at an interval weather_thread = Thread(target=record_readings)