mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[easee] Fix binding not working after Easee cloud API has been unavailable (#13469)
* fix #13463 Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
parent
c9decdbe49
commit
e9848e27e8
@ -222,7 +222,7 @@ public class WebInterface implements AtomicReferenceTrait {
|
|||||||
private synchronized void refreshAccessToken() {
|
private synchronized void refreshAccessToken() {
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
|
|
||||||
if (now.isAfter(tokenExpiry.minus(WEB_REQUEST_TOKEN_EXPIRY_BUFFER_MINUTES, ChronoUnit.MINUTES))
|
if (now.plus(WEB_REQUEST_TOKEN_EXPIRY_BUFFER_MINUTES, ChronoUnit.MINUTES).isAfter(tokenExpiry)
|
||||||
|| now.isAfter(tokenRefreshDate.plus(WEB_REQUEST_TOKEN_MAX_AGE_MINUTES, ChronoUnit.MINUTES))) {
|
|| now.isAfter(tokenRefreshDate.plus(WEB_REQUEST_TOKEN_MAX_AGE_MINUTES, ChronoUnit.MINUTES))) {
|
||||||
logger.debug("access token needs to be refreshed, last refresh: {}, expiry: {}",
|
logger.debug("access token needs to be refreshed, last refresh: {}, expiry: {}",
|
||||||
Utils.formatDate(tokenRefreshDate), Utils.formatDate(tokenExpiry));
|
Utils.formatDate(tokenRefreshDate), Utils.formatDate(tokenExpiry));
|
||||||
|
Loading…
Reference in New Issue
Block a user