Browse Source

feat: enable Write Ahead Log mode for SQLite (#681)

Co-authored-by: Karol Sójko <karolsojko@proton.me>
Karol Sójko 1 năm trước cách đây
mục cha
commit
8cd7a138ab

+ 2 - 0
packages/auth/src/Bootstrap/DataSource.ts

@@ -114,6 +114,8 @@ export class AppDataSource {
         ...commonDataSourceOptions,
         ...commonDataSourceOptions,
         type: 'sqlite',
         type: 'sqlite',
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
+        enableWAL: true,
+        busyErrorRetry: 2000,
       }
       }
 
 
       this._dataSource = new DataSource(sqliteDataSourceOptions)
       this._dataSource = new DataSource(sqliteDataSourceOptions)

+ 2 - 0
packages/revisions/src/Bootstrap/DataSource.ts

@@ -80,6 +80,8 @@ export class AppDataSource {
         ...commonDataSourceOptions,
         ...commonDataSourceOptions,
         type: 'sqlite',
         type: 'sqlite',
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
+        enableWAL: true,
+        busyErrorRetry: 2000,
       }
       }
 
 
       this.dataSource = new DataSource(sqliteDataSourceOptions)
       this.dataSource = new DataSource(sqliteDataSourceOptions)

+ 2 - 0
packages/syncing-server/src/Bootstrap/DataSource.ts

@@ -98,6 +98,8 @@ export class AppDataSource {
         ...commonDataSourceOptions,
         ...commonDataSourceOptions,
         type: 'sqlite',
         type: 'sqlite',
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
         database: this.env.get('DB_SQLITE_DATABASE_PATH'),
+        enableWAL: true,
+        busyErrorRetry: 2000,
       }
       }
 
 
       this._dataSource = new DataSource(sqliteDataSourceOptions)
       this._dataSource = new DataSource(sqliteDataSourceOptions)