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

This commit is contained in:
Johann Kellerman 2017-02-10 22:22:15 +02:00 committed by GitHub
parent 23ff2eb79c
commit cbf3a2ecae

View File

@ -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