mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
Merge branch 'main' of https://github.com/burrow-dev/burrow-server
This commit is contained in:
commit
08780d7e69
2 files changed
+9
-3
No files matched your search
+5
-2
@@ -366,8 +366,11 @@ const load = () => {
|
||||
fs.mkdirSync(config.dataDir, {recursive: true});
|
||||
db = new DatabaseSync(path.join(config.dataDir, "game.sqlite"));
|
||||
// busy_timeout: something else writing to the file for a moment (a tool,
|
||||
// a copy being made) is waited for, not an error.
|
||||
db.exec("PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON; PRAGMA busy_timeout = 5000;");
|
||||
// a copy being made) is waited for, not an error. synchronous NORMAL: with
|
||||
// WAL the disk is synced at checkpoints, not after every commit, which
|
||||
// held the game up on each chat line and save; a crash of the server
|
||||
// loses nothing, a power cut at most the last moment's writes.
|
||||
db.exec("PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA foreign_keys = ON; PRAGMA busy_timeout = 5000;");
|
||||
db.exec(SCHEMA);
|
||||
for (const row of db.prepare("SELECT * FROM accounts").all()) {
|
||||
const account = normalize({
|
||||
|
||||
Reference in new issue
Block a user