Change weather update worker strategy to UPDATE
This commit is contained in:
parent
8d71b41163
commit
9d98756fa7
@ -76,7 +76,7 @@ internal class WeatherRepositoryImpl(
|
|||||||
.build()
|
.build()
|
||||||
WorkManager.getInstance(context).enqueueUniquePeriodicWork(
|
WorkManager.getInstance(context).enqueueUniquePeriodicWork(
|
||||||
"weather",
|
"weather",
|
||||||
ExistingPeriodicWorkPolicy.KEEP, weatherRequest
|
ExistingPeriodicWorkPolicy.UPDATE, weatherRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
scope.launch {
|
scope.launch {
|
||||||
@ -216,7 +216,7 @@ class WeatherUpdateWorker(
|
|||||||
val lastUpdate = settingsData.lastUpdate
|
val lastUpdate = settingsData.lastUpdate
|
||||||
|
|
||||||
if (lastUpdate + updateInterval > System.currentTimeMillis()) {
|
if (lastUpdate + updateInterval > System.currentTimeMillis()) {
|
||||||
Log.d("MM20", "No weather update required")
|
Log.d("WeatherUpdateWorker", "No weather update required")
|
||||||
return Result.failure()
|
return Result.failure()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user