diff --git a/app/src/main/java/eu/faircode/email/WorkerDailyRules.java b/app/src/main/java/eu/faircode/email/WorkerDailyRules.java index 5d32badd0a..3bed00d52d 100644 --- a/app/src/main/java/eu/faircode/email/WorkerDailyRules.java +++ b/app/src/main/java/eu/faircode/email/WorkerDailyRules.java @@ -154,6 +154,7 @@ public class WorkerDailyRules extends Worker { delay = cal.getTimeInMillis() - now; EntityLog.log(context, EntityLog.Type.Rules, "Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m"); + WorkManager.getInstance(context).cancelUniqueWork(getName()); PeriodicWorkRequest.Builder builder = new PeriodicWorkRequest.Builder(WorkerDailyRules.class, 1, TimeUnit.DAYS) .setInitialDelay(delay, TimeUnit.MILLISECONDS); diff --git a/app/src/main/java/eu/faircode/email/WorkerSync.java b/app/src/main/java/eu/faircode/email/WorkerSync.java index 7a2e84fee3..bf7c8fd4e7 100644 --- a/app/src/main/java/eu/faircode/email/WorkerSync.java +++ b/app/src/main/java/eu/faircode/email/WorkerSync.java @@ -92,6 +92,7 @@ public class WorkerSync extends Worker { EntityLog.log(context, EntityLog.Type.Cloud, "Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m"); + WorkManager.getInstance(context).cancelUniqueWork(getName()); PeriodicWorkRequest.Builder builder = new PeriodicWorkRequest.Builder(WorkerSync.class, 1, TimeUnit.DAYS) .setInitialDelay(delay, TimeUnit.MILLISECONDS)