Update work

pull/215/head
M66B 5 months ago
parent 0bebbc1c0f
commit 478af42d1e

@ -158,7 +158,7 @@ public class WorkerDailyRules extends Worker {
new PeriodicWorkRequest.Builder(WorkerDailyRules.class, 1, TimeUnit.DAYS)
.setInitialDelay(delay, TimeUnit.MILLISECONDS);
WorkManager.getInstance(context)
.enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.KEEP, builder.build());
.enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.UPDATE, builder.build());
EntityLog.log(context, EntityLog.Type.Rules, "Queued " + getName());
} else {
EntityLog.log(context, EntityLog.Type.Rules, "Cancelling " + getName());

@ -98,7 +98,7 @@ public class WorkerSync extends Worker {
.setConstraints(new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED).build());
WorkManager.getInstance(context)
.enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.KEEP, builder.build());
.enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.UPDATE, builder.build());
Log.i("Queued " + getName());
} else {
EntityLog.log(context, EntityLog.Type.Cloud,

Loading…
Cancel
Save