[gardena] synchronized (#13253)

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2022-08-12 16:32:51 +01:00 committed by GitHub
parent 2d53243de7
commit bff2298b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ public class GardenaSmartWebSocket {
/**
* Sends a ping to tell the Gardena smart system that the client is alive.
*/
private void sendKeepAlivePing() {
private synchronized void sendKeepAlivePing() {
final PostOAuth2Response accessToken = token;
if ((Instant.now().getEpochSecond() - lastPong.getEpochSecond() > WEBSOCKET_IDLE_TIMEOUT) || accessToken == null
|| accessToken.isAccessTokenExpired()) {