From fd654f25b8e93e042dd5baa4a17b0bc22fe29a26 Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Mon, 1 May 2017 03:14:50 +0200 Subject: [PATCH] Flush metadata buffer when exiting gracefully --- magneticod/magneticod/persistence.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/magneticod/magneticod/persistence.py b/magneticod/magneticod/persistence.py index afd9077..c1f73fd 100644 --- a/magneticod/magneticod/persistence.py +++ b/magneticod/magneticod/persistence.py @@ -131,4 +131,6 @@ class Database: cur.close() def close(self) -> None: + if self.__pending_metadata: + self.__commit_metadata() self.__db_conn.close()