Disable the cross-process lock in the SDK (#6231)
* Disable the cross-process lock in the SDK We don't use multiple process as iOS does, so we don't need it. It should improve DB performance a bit and overall waste less resources.
This commit is contained in:
parent
82ef2e0f99
commit
8877f1010c
2 changed files with 5 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.Client
|
||||
import org.matrix.rustcomponents.sdk.ClientBuilder
|
||||
import org.matrix.rustcomponents.sdk.CrossProcessLockConfig
|
||||
import org.matrix.rustcomponents.sdk.RequestConfig
|
||||
import org.matrix.rustcomponents.sdk.Session
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncVersion
|
||||
|
|
@ -173,6 +174,8 @@ class RustMatrixClientFactory(
|
|||
maxRetryTime = null,
|
||||
)
|
||||
)
|
||||
// Make sure all built clients use the single process cross-process lock config
|
||||
.crossProcessLockConfig(CrossProcessLockConfig.SingleProcess)
|
||||
.run {
|
||||
// Apply sliding sync version settings
|
||||
when (slidingSyncType) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ package io.element.android.libraries.matrix.impl.fixtures.fakes
|
|||
import org.matrix.rustcomponents.sdk.Client
|
||||
import org.matrix.rustcomponents.sdk.ClientBuilder
|
||||
import org.matrix.rustcomponents.sdk.ClientSessionDelegate
|
||||
import org.matrix.rustcomponents.sdk.CrossProcessLockConfig
|
||||
import org.matrix.rustcomponents.sdk.NoHandle
|
||||
import org.matrix.rustcomponents.sdk.RequestConfig
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncVersionBuilder
|
||||
|
|
@ -45,5 +46,6 @@ class FakeFfiClientBuilder(
|
|||
override fun threadsEnabled(enabled: Boolean, threadSubscriptions: Boolean): ClientBuilder = this
|
||||
override fun sqliteStore(config: SqliteStoreBuilder): ClientBuilder = this
|
||||
override fun inMemoryStore(): ClientBuilder = this
|
||||
override fun crossProcessLockConfig(crossProcessLockConfig: CrossProcessLockConfig): ClientBuilder = this
|
||||
override suspend fun build() = buildResult()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue