From fff204c43c75e2d2a55c93e1b728e8fc8353630b Mon Sep 17 00:00:00 2001 From: Brutus5000 Date: Sat, 4 May 2024 00:28:36 +0200 Subject: [PATCH] Calculate seconds correctly in ConnectivityChecker #2 --- .../com/faforever/ice/connectivitycheck/ConnectivityChecker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kia-lib/src/main/kotlin/com/faforever/ice/connectivitycheck/ConnectivityChecker.kt b/kia-lib/src/main/kotlin/com/faforever/ice/connectivitycheck/ConnectivityChecker.kt index 1d6bf48..fb61bce 100644 --- a/kia-lib/src/main/kotlin/com/faforever/ice/connectivitycheck/ConnectivityChecker.kt +++ b/kia-lib/src/main/kotlin/com/faforever/ice/connectivitycheck/ConnectivityChecker.kt @@ -81,7 +81,7 @@ class ConnectivityChecker( } ChronoUnit.SECONDS.between(connectionState.lastEchoRequested, now) > connectionEchoPendingSeconds && - Duration.between(connectionState.lastEchoRequested, connectionState.lastEchoReceived).seconds < connectionEchoPendingSeconds -> ECHO_REQUIRED.also { + ChronoUnit.SECONDS.between(connectionState.lastEchoRequested, connectionState.lastEchoReceived) < connectionEchoPendingSeconds -> ECHO_REQUIRED.also { logger.trace { "[$connectivityCheckable] Echo waiting time within threshold, keep waiting" } }