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) new PeriodicWorkRequest.Builder(WorkerDailyRules.class, 1, TimeUnit.DAYS)
.setInitialDelay(delay, TimeUnit.MILLISECONDS); .setInitialDelay(delay, TimeUnit.MILLISECONDS);
WorkManager.getInstance(context) WorkManager.getInstance(context)
.enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.KEEP, builder.build()); .enqueueUniquePeriodicWork(getName(), ExistingPeriodicWorkPolicy.UPDATE, builder.build());
EntityLog.log(context, EntityLog.Type.Rules, "Queued " + getName()); EntityLog.log(context, EntityLog.Type.Rules, "Queued " + getName());
} else { } else {
EntityLog.log(context, EntityLog.Type.Rules, "Cancelling " + getName()); EntityLog.log(context, EntityLog.Type.Rules, "Cancelling " + getName());

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

Loading…
Cancel
Save