From 749fc10ddae015146bc8e9f622723559fbfbd7fa Mon Sep 17 00:00:00 2001 From: Lilian Gallon Date: Mon, 16 Sep 2024 11:19:53 +0200 Subject: [PATCH] feat(wamp-server) #76: fixup! while --- .../main/kotlin/com/izivia/ocpp/wamp/core/WampCallManager.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ocpp-wamp/src/main/kotlin/com/izivia/ocpp/wamp/core/WampCallManager.kt b/ocpp-wamp/src/main/kotlin/com/izivia/ocpp/wamp/core/WampCallManager.kt index 6dc0e594..5ed25e42 100644 --- a/ocpp-wamp/src/main/kotlin/com/izivia/ocpp/wamp/core/WampCallManager.kt +++ b/ocpp-wamp/src/main/kotlin/com/izivia/ocpp/wamp/core/WampCallManager.kt @@ -87,10 +87,9 @@ class WampCallManager( fun await() { val now = Clock.System.now() synchronized(this) { - val capturedCurentCall = currentCall while ( - capturedCurentCall != null && - (Clock.System.now() - now).inWholeMilliseconds < capturedCurentCall.timeoutInMs + currentCall != null && + (Clock.System.now() - now).inWholeMilliseconds < (currentCall?.timeoutInMs ?: Long.MAX_VALUE) ) { Thread.sleep(10) }