Skip to content

Commit

Permalink
DB: Don't backup on first launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikekson committed Mar 5, 2023
1 parent d86c88d commit 984e79b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/db/xmDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,23 @@ bool xmDatabase::init(const std::string &i_dbFileUTF8,
}

if (m_openingVersion < XMDB_VERSION) {
LogInfo("Backing up XmDb");

try {
backupXmDb(i_dbFileUTF8);
} catch (Exception &e) {
LogError("Failed to backup database:");
LogError(e.getMsg().c_str());
LogError("Bailing out..");

if (m_db != NULL) {
sqlite3_close(m_db);
m_db = NULL;
}
if (m_openingVersion != 0) {
LogInfo("Backing up XmDb");

try {
backupXmDb(i_dbFileUTF8);
} catch (Exception &e) {
LogError("Failed to backup database:");
LogError(e.getMsg().c_str());
LogError("Bailing out..");

return false;
if (m_db != NULL) {
sqlite3_close(m_db);
m_db = NULL;
}

return false;
}
}

LogInfo(
Expand Down

0 comments on commit 984e79b

Please sign in to comment.