mirror of https://github.com/readrops/Readrops.git
Use the choosen interval as the worker initial delay
This commit is contained in:
parent
e39c16d635
commit
a8764e91f5
|
@ -77,7 +77,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
||||||
PeriodicWorkRequest request = new PeriodicWorkRequest.Builder(SyncWorker.class, interval.first, interval.second)
|
PeriodicWorkRequest request = new PeriodicWorkRequest.Builder(SyncWorker.class, interval.first, interval.second)
|
||||||
.addTag(SyncWorker.Companion.getTAG())
|
.addTag(SyncWorker.Companion.getTAG())
|
||||||
.setConstraints(constraints)
|
.setConstraints(constraints)
|
||||||
.setInitialDelay(15, TimeUnit.MINUTES)
|
.setInitialDelay(interval.first, interval.second)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
workManager.enqueueUniquePeriodicWork(SyncWorker.Companion.getTAG(), ExistingPeriodicWorkPolicy.REPLACE, request);
|
workManager.enqueueUniquePeriodicWork(SyncWorker.Companion.getTAG(), ExistingPeriodicWorkPolicy.REPLACE, request);
|
||||||
|
|
Loading…
Reference in New Issue