From 478af42d1e2f612e68236bb7ed7d15373492d51b Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 12 Aug 2024 15:59:54 +0200 Subject: [PATCH] Update work --- app/src/main/java/eu/faircode/email/WorkerDailyRules.java | 2 +- app/src/main/java/eu/faircode/email/WorkerSync.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WorkerDailyRules.java b/app/src/main/java/eu/faircode/email/WorkerDailyRules.java index 5d32badd0a..2949769542 100644 --- a/app/src/main/java/eu/faircode/email/WorkerDailyRules.java +++ b/app/src/main/java/eu/faircode/email/WorkerDailyRules.java @@ -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()); diff --git a/app/src/main/java/eu/faircode/email/WorkerSync.java b/app/src/main/java/eu/faircode/email/WorkerSync.java index 7a2e84fee3..a37ecffb25 100644 --- a/app/src/main/java/eu/faircode/email/WorkerSync.java +++ b/app/src/main/java/eu/faircode/email/WorkerSync.java @@ -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,