mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
feat(database): enable WAL connection pool for parallel reads
Room 3.0.0-alpha04 adds setMultipleConnectionPool(). Enable it with 4 readers / 1 writer to allow concurrent read operations (paging, multiple Flow collectors) without contention. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -120,7 +120,9 @@ abstract class MeshtasticDatabase : RoomDatabase() {
|
||||
companion object {
|
||||
/** Configures a [RoomDatabase.Builder] with standard settings for this project. */
|
||||
fun <T : RoomDatabase> RoomDatabase.Builder<T>.configureCommon(): RoomDatabase.Builder<T> =
|
||||
this.fallbackToDestructiveMigration(dropAllTables = false).setQueryCoroutineContext(ioDispatcher)
|
||||
this.fallbackToDestructiveMigration(dropAllTables = false)
|
||||
.setMultipleConnectionPool(maxNumOfReaders = 4, maxNumOfWriters = 1)
|
||||
.setQueryCoroutineContext(ioDispatcher)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user