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

Signed-off-by: MPH80 <michael@hazelden.me>
  • Loading branch information
lolodomo authored and MPH80 committed Aug 3, 2020
1 parent b9c3e88 commit a753452
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 a753452

Please sign in to comment.