use TAG to identify CleanCacheWorker to WorkManager
TAG is already there, and it is meant to identify this class, and be unique.
This commit is contained in:
parent
06dbd048af
commit
9eba243092
@ -52,8 +52,7 @@ public class CleanCacheWorker extends Worker {
|
|||||||
new PeriodicWorkRequest.Builder(CleanCacheWorker.class, interval, TimeUnit.MILLISECONDS)
|
new PeriodicWorkRequest.Builder(CleanCacheWorker.class, interval, TimeUnit.MILLISECONDS)
|
||||||
.setConstraints(constraintsBuilder.build())
|
.setConstraints(constraintsBuilder.build())
|
||||||
.build();
|
.build();
|
||||||
workManager.enqueueUniquePeriodicWork("clean_cache",
|
workManager.enqueueUniquePeriodicWork(TAG, ExistingPeriodicWorkPolicy.REPLACE, cleanCache);
|
||||||
ExistingPeriodicWorkPolicy.REPLACE, cleanCache);
|
|
||||||
Utils.debugLog(TAG, "Scheduled periodic work for cleaning the cache.");
|
Utils.debugLog(TAG, "Scheduled periodic work for cleaning the cache.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user