Avoid recorder thread crashing (#21668)

This commit is contained in:
Paulus Schoutsen 2019-03-04 16:01:31 -08:00 committed by Paulus Schoutsen
parent a778cd117f
commit b20b811cb9

View File

@ -318,6 +318,10 @@ class Recorder(threading.Thread):
CONNECT_RETRY_WAIT)
tries += 1
except exc.SQLAlchemyError:
updated = True
_LOGGER.exception("Error saving event: %s", event)
if not updated:
_LOGGER.error("Error in database update. Could not save "
"after %d tries. Giving up", tries)