From ad03e32f77200ac2492606f71966880792c1003d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 5 Aug 2017 12:49:04 -0500 Subject: [PATCH] Don't kill tempmon client if DB session.commit() fails let the daemon keep trying just like when device.read() fails --- rattail_tempmon/client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rattail_tempmon/client.py b/rattail_tempmon/client.py index 4add356..78dd518 100644 --- a/rattail_tempmon/client.py +++ b/rattail_tempmon/client.py @@ -92,9 +92,8 @@ class TempmonClient(Daemon): try: session.commit() except: - # TODO: pretty sure we need to add a retry for this.. - log.exception("failed to commit changes to database") - raise + log.exception("Failed to read/record temperature data (but will keep trying)") + session.rollback() finally: session.close()