mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-30 19:53:58 +03:00
Log the end of the migration and it's duration
This commit is contained in:
parent
069c0c7cb4
commit
ae8f977d6b
1 changed files with 5 additions and 1 deletions
|
@ -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,7 +27,10 @@ internal abstract class RealmMigrator(
|
||||||
) {
|
) {
|
||||||
fun perform() {
|
fun perform() {
|
||||||
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion")
|
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion")
|
||||||
doMigrate(realm)
|
val duration = measureTimeMillis {
|
||||||
|
doMigrate(realm)
|
||||||
|
}
|
||||||
|
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion took $duration ms.")
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun doMigrate(realm: DynamicRealm)
|
abstract fun doMigrate(realm: DynamicRealm)
|
||||||
|
|
Loading…
Add table
Reference in a new issue