mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-06 00:02:48 +02:00
Granfra's review
This commit is contained in:
@@ -17,13 +17,12 @@
|
||||
package org.matrix.android.sdk.internal.database
|
||||
|
||||
import io.realm.DefaultCompactOnLaunchCallback
|
||||
import javax.inject.Inject
|
||||
|
||||
class RealmCompactOnLaunch @Inject constructor() : DefaultCompactOnLaunchCallback() {
|
||||
class RealmCompactOnLaunch : DefaultCompactOnLaunchCallback() {
|
||||
/**
|
||||
* Forces all RealmCompactOnLaunch instances to be equal.
|
||||
* Avoids Realm throwing when multiple instances of this class are used.
|
||||
*/
|
||||
override fun equals(other: Any?) = other is RealmSessionStoreMigration
|
||||
override fun equals(other: Any?) = other is RealmCompactOnLaunch
|
||||
override fun hashCode() = 0x1000
|
||||
}
|
||||
|
@@ -41,7 +41,6 @@ private const val REALM_NAME = "disk_store.realm"
|
||||
internal class SessionRealmConfigurationFactory @Inject constructor(
|
||||
private val realmKeysUtils: RealmKeysUtils,
|
||||
private val realmSessionStoreMigration: RealmSessionStoreMigration,
|
||||
private val realmCompactOnLaunch: RealmCompactOnLaunch,
|
||||
@SessionFilesDirectory val directory: File,
|
||||
@SessionId val sessionId: String,
|
||||
@UserMd5 val userMd5: String,
|
||||
@@ -65,7 +64,7 @@ internal class SessionRealmConfigurationFactory @Inject constructor(
|
||||
}
|
||||
|
||||
val realmConfiguration = RealmConfiguration.Builder()
|
||||
.compactOnLaunch(realmCompactOnLaunch)
|
||||
.compactOnLaunch(RealmCompactOnLaunch())
|
||||
.directory(directory)
|
||||
.name(REALM_NAME)
|
||||
.apply {
|
||||
|
Reference in New Issue
Block a user