Cleanup after merging

This commit is contained in:
Koitharu
2022-07-18 18:19:51 +03:00
parent 094cebe674
commit 1a83d21410
2 changed files with 4 additions and 11 deletions

View File

@@ -1,16 +1,9 @@
package org.koitharu.kotatsu.core.db
import androidx.room.InvalidationTracker
import org.koin.android.ext.koin.androidContext
import org.koin.dsl.module
val databaseModule
get() = module {
single {
MangaDatabase(androidContext()).also { db ->
getAll<InvalidationTracker.Observer>().forEach {
db.invalidationTracker.addObserver(it)
}
}
}
}
single { MangaDatabase(androidContext()) }
}

View File

@@ -34,7 +34,7 @@ class SyncController(
private val mutex = Mutex()
private val jobs = ArrayMap<String, Job>(2)
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>) {
requestSync(
@@ -136,4 +136,4 @@ class SyncController(
favouriteCategoriesDao.gc(deletedAt)
}
}
}
}