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:
committed by
GitHub
parent
b8ce06d80f
commit
496595f20d
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user