mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 18:38:23 +01:00
Fix Migrator not doing work (#604)
This commit is contained in:
parent
7c6fd026a3
commit
6b3423a12b
@ -2,6 +2,7 @@ package mihon.core.migration
|
|||||||
|
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.CoroutineStart
|
||||||
import kotlinx.coroutines.Deferred
|
import kotlinx.coroutines.Deferred
|
||||||
import kotlinx.coroutines.async
|
import kotlinx.coroutines.async
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
@ -17,7 +18,7 @@ class MigrationJobFactory(
|
|||||||
.fold(CompletableDeferred(true)) { acc: Deferred<Boolean>, migration: Migration ->
|
.fold(CompletableDeferred(true)) { acc: Deferred<Boolean>, migration: Migration ->
|
||||||
if (!migrationContext.dryrun) {
|
if (!migrationContext.dryrun) {
|
||||||
logcat { "Running migration: { name = ${migration::class.simpleName}, version = ${migration.version} }" }
|
logcat { "Running migration: { name = ${migration::class.simpleName}, version = ${migration.version} }" }
|
||||||
async {
|
async(start = CoroutineStart.UNDISPATCHED) {
|
||||||
val prev = acc.await()
|
val prev = acc.await()
|
||||||
migration(migrationContext) || prev
|
migration(migrationContext) || prev
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user