mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 23:12:44 +01:00
Avoid fmt when constructor already does it
There is a correctnes issue here, but #3724 will fix that. This is just a cleanup for brevity's sake.
This commit is contained in:
parent
b135de2b5f
commit
75b62e5260
8 changed files with 73 additions and 51 deletions
|
|
@ -482,18 +482,18 @@ void LocalStore::openDB(State & state, bool create)
|
|||
SQLiteStmt stmt;
|
||||
stmt.create(db, "pragma main.journal_mode;");
|
||||
if (sqlite3_step(stmt) != SQLITE_ROW)
|
||||
throwSQLiteError(db, "querying journal mode");
|
||||
SQLiteError::throw_(db, "querying journal mode");
|
||||
prevMode = std::string((const char *) sqlite3_column_text(stmt, 0));
|
||||
}
|
||||
if (prevMode != mode &&
|
||||
sqlite3_exec(db, ("pragma main.journal_mode = " + mode + ";").c_str(), 0, 0, 0) != SQLITE_OK)
|
||||
throwSQLiteError(db, "setting journal mode");
|
||||
SQLiteError::throw_(db, "setting journal mode");
|
||||
|
||||
/* Increase the auto-checkpoint interval to 40000 pages. This
|
||||
seems enough to ensure that instantiating the NixOS system
|
||||
derivation is done in a single fsync(). */
|
||||
if (mode == "wal" && sqlite3_exec(db, "pragma wal_autocheckpoint = 40000;", 0, 0, 0) != SQLITE_OK)
|
||||
throwSQLiteError(db, "setting autocheckpoint interval");
|
||||
SQLiteError::throw_(db, "setting autocheckpoint interval");
|
||||
|
||||
/* Initialise the database schema, if necessary. */
|
||||
if (create) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue