mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-18 20:39:57 +01:00
Log the end of the migration and it's duration
This commit is contained in:
parent
069c0c7cb4
commit
ae8f977d6b
@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.util.database
|
|||||||
import io.realm.DynamicRealm
|
import io.realm.DynamicRealm
|
||||||
import io.realm.RealmObjectSchema
|
import io.realm.RealmObjectSchema
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
import kotlin.system.measureTimeMillis
|
||||||
|
|
||||||
internal abstract class RealmMigrator(
|
internal abstract class RealmMigrator(
|
||||||
private val realm: DynamicRealm,
|
private val realm: DynamicRealm,
|
||||||
@ -26,8 +27,11 @@ internal abstract class RealmMigrator(
|
|||||||
) {
|
) {
|
||||||
fun perform() {
|
fun perform() {
|
||||||
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion")
|
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion")
|
||||||
|
val duration = measureTimeMillis {
|
||||||
doMigrate(realm)
|
doMigrate(realm)
|
||||||
}
|
}
|
||||||
|
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion took $duration ms.")
|
||||||
|
}
|
||||||
|
|
||||||
abstract fun doMigrate(realm: DynamicRealm)
|
abstract fun doMigrate(realm: DynamicRealm)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user