Avoid recorder thread crashing (#21668)

This commit is contained in:
Paulus Schoutsen 2019-03-04 16:01:31 -08:00 committed by GitHub
parent e10e27d809
commit df25128923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)