Revert "Skip cancelling work"

This reverts commit 68e45b321b.
pull/215/head
M66B 4 months ago
parent 17265d17b7
commit d68e9b2972

@ -154,6 +154,7 @@ public class WorkerDailyRules extends Worker {
delay = cal.getTimeInMillis() - now; delay = cal.getTimeInMillis() - now;
EntityLog.log(context, EntityLog.Type.Rules, "Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m"); EntityLog.log(context, EntityLog.Type.Rules, "Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m");
WorkManager.getInstance(context).cancelUniqueWork(getName());
PeriodicWorkRequest.Builder builder = PeriodicWorkRequest.Builder builder =
new PeriodicWorkRequest.Builder(WorkerDailyRules.class, 1, TimeUnit.DAYS) new PeriodicWorkRequest.Builder(WorkerDailyRules.class, 1, TimeUnit.DAYS)
.setInitialDelay(delay, TimeUnit.MILLISECONDS); .setInitialDelay(delay, TimeUnit.MILLISECONDS);

@ -92,6 +92,7 @@ public class WorkerSync extends Worker {
EntityLog.log(context, EntityLog.Type.Cloud, EntityLog.log(context, EntityLog.Type.Cloud,
"Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m"); "Queuing " + getName() + " delay=" + (delay / (60 * 1000L)) + "m");
WorkManager.getInstance(context).cancelUniqueWork(getName());
PeriodicWorkRequest.Builder builder = PeriodicWorkRequest.Builder builder =
new PeriodicWorkRequest.Builder(WorkerSync.class, 1, TimeUnit.DAYS) new PeriodicWorkRequest.Builder(WorkerSync.class, 1, TimeUnit.DAYS)
.setInitialDelay(delay, TimeUnit.MILLISECONDS) .setInitialDelay(delay, TimeUnit.MILLISECONDS)

Loading…
Cancel
Save