mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-18 21:16:48 -06:00
Again fix rejected execution in sync worker (#310)
This commit is contained in:
parent
b97b94ae29
commit
8601093725
@ -86,8 +86,8 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
implementation "androidx.work:work-runtime:2.0.0"
|
||||
implementation "androidx.work:work-rxjava2:2.0.0"
|
||||
implementation "android.arch.work:work-runtime:1.0.0"
|
||||
implementation "android.arch.work:work-rxjava2:1.0.0"
|
||||
|
||||
implementation "androidx.room:room-runtime:2.1.0-alpha06"
|
||||
implementation "androidx.room:room-rxjava2:2.1.0-alpha06"
|
||||
|
@ -40,7 +40,7 @@ class SyncManager @Inject constructor(
|
||||
fun startSyncWorker(restart: Boolean = false) {
|
||||
if (preferencesRepository.isServiceEnabled && !now().isHolidays) {
|
||||
workManager.enqueueUniquePeriodicWork(SyncWorker::class.java.simpleName, if (restart) REPLACE else KEEP,
|
||||
PeriodicWorkRequest.Builder(SyncWorker::class.java, preferencesRepository.servicesInterval, MINUTES)
|
||||
PeriodicWorkRequest.Builder(SyncWorker::class.java, preferencesRepository.servicesInterval, MINUTES, 10, MINUTES)
|
||||
.setBackoffCriteria(EXPONENTIAL, 30, MINUTES)
|
||||
.setConstraints(Constraints.Builder()
|
||||
.setRequiredNetworkType(if (preferencesRepository.isServicesOnlyWifi) METERED else UNMETERED)
|
||||
|
Loading…
x
Reference in New Issue
Block a user