[recorder] Run end model changed in session scope (#5858)

This commit is contained in:
Johann Kellerman authored and GitHub committed 2017-02-10 22:22:15 +02:00
1 parent 23ff2eb79c
commit cbf3a2ecae
1 file changed
+1 -1
@@ -421,8 +421,8 @@ class Recorder(threading.Thread):
def _close_run(self):
"""Save end time for current run."""
self._run.end = dt_util.utcnow()
with session_scope() as session:
self._run.end = dt_util.utcnow()
self._commit(session, self._run)
self._run = None