Disable fsync during backup import
This commit is contained in:
parent
5773fc1ace
commit
46c8d26db9
1 changed files with 9 additions and 0 deletions
|
@ -7510,6 +7510,9 @@ function disableMessageInsertTriggers(db: WritableDB): void {
|
||||||
db.exec('DROP TRIGGER IF EXISTS messages_on_insert;');
|
db.exec('DROP TRIGGER IF EXISTS messages_on_insert;');
|
||||||
db.exec('DROP TRIGGER IF EXISTS messages_on_insert_insert_mentions;');
|
db.exec('DROP TRIGGER IF EXISTS messages_on_insert_insert_mentions;');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
db.pragma('checkpoint_fullfsync = false');
|
||||||
|
db.pragma('synchronous = OFF');
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectMentionsFromMessages = `
|
const selectMentionsFromMessages = `
|
||||||
|
@ -7549,6 +7552,12 @@ function enableMessageInsertTriggersAndBackfill(db: WritableDB): void {
|
||||||
value: false,
|
value: false,
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
db.pragma('checkpoint_fullfsync = true');
|
||||||
|
db.pragma('synchronous = FULL');
|
||||||
|
|
||||||
|
// Finally fully commit WAL into the database
|
||||||
|
db.pragma('wal_checkpoint(FULL)');
|
||||||
}
|
}
|
||||||
|
|
||||||
function backfillMessagesFtsTable(db: WritableDB): void {
|
function backfillMessagesFtsTable(db: WritableDB): void {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue