From 4d55a120d8fa5564a439102ab97b43da589bf4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Wed, 21 Jun 2017 17:36:53 +0200 Subject: Re-implement correctly the handling of failure to open the database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we can’t open it at startup, we exit. If we can’t open it on reload, we keep the previously-opened database. This way, we’re assured to always have a valid and open database available. --- src/utils/reload.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/reload.cpp b/src/utils/reload.cpp index 807a9ab..fdca9bc 100644 --- a/src/utils/reload.cpp +++ b/src/utils/reload.cpp @@ -11,7 +11,6 @@ void open_database() #ifdef USE_DATABASE const auto db_filename = Config::get("db_name", xdg_data_path("biboumi.sqlite")); log_info("Opening database: ", db_filename); - Database::close(); Database::open(db_filename); log_info("database successfully opened."); #endif -- cgit v1.2.3