diff --git a/app/build.gradle b/app/build.gradle index 509e146f..935710c5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/SyncManager.kt b/app/src/main/java/io/github/wulkanowy/services/sync/SyncManager.kt index 7a9a9956..c1820afb 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/SyncManager.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/SyncManager.kt @@ -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)