Force restart jobs

This commit is contained in:
M66B 2023-05-24 07:11:00 +02:00
parent 76ec103739
commit 11195fe500
2 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,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);

View File

@ -90,6 +90,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)