From b20b811cb936d387518b1bdc611b1239be2c78a6 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 4 Mar 2019 16:01:31 -0800 Subject: [PATCH] Avoid recorder thread crashing (#21668) --- homeassistant/components/recorder/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index e0af36ea409..6c338457b34 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -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)