Re-implement correctly the handling of failure to open the database
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.
This commit is contained in:
1 parent
651caabb2d
commit
4d55a120d8
2 files changed
+12
-3
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user