Skip to content

Commit

Permalink
[netatmo] Make safe the execution of the refresh token job (openhab#8127
Browse files Browse the repository at this point in the history
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
  • Loading branch information
lolodomo authored and andrewfg committed Aug 31, 2020
1 parent 9814a9b commit 56d7145
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ private void scheduleTokenInitAndRefresh() {
return;
}
}
} catch (RuntimeException e) {
logger.warn("Unable to connect Netatmo API : {}", e.getMessage(), e);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Netatmo Access Failed, will retry in " + configuration.reconnectInterval + " seconds.");
}
// We'll do this every x seconds to guaranty token refresh
}, 2, configuration.reconnectInterval, TimeUnit.SECONDS);
Expand Down

0 comments on commit 56d7145

Please sign in to comment.