require fewer network interactions during build

This commit is contained in:
2023-11-13 04:12:29 +00:00
parent 01630edd13
commit a6c1462b3a
3 changed files with 406 additions and 13 deletions

View File

@@ -511,7 +511,6 @@ function openAndMigrateDatabase(
let db: Database | undefined;
// First, we try to open the database without any cipher changes
try {
db = new SQL(filePath, {
readonly,
});
@@ -520,12 +519,6 @@ function openAndMigrateDatabase(
migrateSchemaVersion(db);
return db;
} catch (error) {
if (db) {
db.close();
}
logger.info('migrateDatabase: Migration without cipher change failed');
}
// If that fails, we try to open the database with 3.x compatibility to extract the
// user_version (previously stored in schema_version, blown away by cipher_migrate).