Cleanup after merging
This commit is contained in:
@@ -1,16 +1,9 @@
|
|||||||
package org.koitharu.kotatsu.core.db
|
package org.koitharu.kotatsu.core.db
|
||||||
|
|
||||||
import androidx.room.InvalidationTracker
|
|
||||||
import org.koin.android.ext.koin.androidContext
|
import org.koin.android.ext.koin.androidContext
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
val databaseModule
|
val databaseModule
|
||||||
get() = module {
|
get() = module {
|
||||||
single {
|
single { MangaDatabase(androidContext()) }
|
||||||
MangaDatabase(androidContext()).also { db ->
|
}
|
||||||
getAll<InvalidationTracker.Observer>().forEach {
|
|
||||||
db.invalidationTracker.addObserver(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class SyncController(
|
|||||||
private val mutex = Mutex()
|
private val mutex = Mutex()
|
||||||
private val jobs = ArrayMap<String, Job>(2)
|
private val jobs = ArrayMap<String, Job>(2)
|
||||||
private val defaultGcPeriod: Long // gc period if sync disabled
|
private val defaultGcPeriod: Long // gc period if sync disabled
|
||||||
get() = TimeUnit.DAYS.toMillis(2)
|
get() = TimeUnit.HOURS.toMillis(2)
|
||||||
|
|
||||||
override fun onInvalidated(tables: MutableSet<String>) {
|
override fun onInvalidated(tables: MutableSet<String>) {
|
||||||
requestSync(
|
requestSync(
|
||||||
@@ -136,4 +136,4 @@ class SyncController(
|
|||||||
favouriteCategoriesDao.gc(deletedAt)
|
favouriteCategoriesDao.gc(deletedAt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user