Disable fsync during backup import

This commit is contained in:
Fedor Indutny 2025-01-15 10:56:21 -08:00 committed by GitHub
parent 5773fc1ace
commit 46c8d26db9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {