Change weather update worker strategy to UPDATE

This commit is contained in:
MM20 2024-12-21 14:42:20 +01:00
parent 8d71b41163
commit 9d98756fa7
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -76,7 +76,7 @@ internal class WeatherRepositoryImpl(
.build()
WorkManager.getInstance(context).enqueueUniquePeriodicWork(
"weather",
ExistingPeriodicWorkPolicy.KEEP, weatherRequest
ExistingPeriodicWorkPolicy.UPDATE, weatherRequest
)
scope.launch {
@ -216,7 +216,7 @@ class WeatherUpdateWorker(
val lastUpdate = settingsData.lastUpdate
if (lastUpdate + updateInterval > System.currentTimeMillis()) {
Log.d("MM20", "No weather update required")
Log.d("WeatherUpdateWorker", "No weather update required")
return Result.failure()
}