Skip to content

Commit 4bb9cdc

Browse files
committed
WeatherDataLoader: check for outdated observation if update time is over 2hrs
1 parent a748b9e commit 4bb9cdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared_resources/src/main/java/com/thewizrd/shared_resources/weatherdata/WeatherDataLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ private void checkForOutdatedObservation() {
262262
if (weather != null) {
263263
// Check for outdated observation
264264
final ZonedDateTime now = ZonedDateTime.now().withZoneSameInstant(location.getTzOffset());
265-
long duraMins = weather.getCondition().getObservationTime() == null ? 61 : Duration.between(weather.getCondition().getObservationTime(), now).toMinutes();
266-
if (duraMins > 60) {
265+
long duraMins = weather.getCondition().getObservationTime() == null ? 121 : Duration.between(weather.getCondition().getObservationTime(), now).toMinutes();
266+
if (duraMins > 120) {
267267
HourlyForecast hrf = Settings.getFirstHourlyForecastDataByDate(location.getQuery(), now.truncatedTo(ChronoUnit.HOURS));
268268
if (hrf != null) {
269269
weather.getCondition().setWeather(hrf.getCondition());

0 commit comments

Comments
 (0)