From fa49acded0a6857e09fa6710bb07e813681739c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horv=C3=A1th=20Istv=C3=A1n?= Date: Sat, 16 Mar 2024 17:11:34 +0100 Subject: [PATCH] Use unix time in token availability check --- .../hu/bme/sch/cmsch/component/token/TokenCollectorService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenCollectorService.kt b/backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenCollectorService.kt index 2dc0059fd..6a90f663b 100644 --- a/backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenCollectorService.kt +++ b/backend/src/main/kotlin/hu/bme/sch/cmsch/component/token/TokenCollectorService.kt @@ -16,6 +16,7 @@ import org.springframework.retry.annotation.Retryable import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Isolation import org.springframework.transaction.annotation.Transactional +import java.time.Instant import java.util.* import kotlin.jvm.optionals.getOrNull @@ -153,7 +154,7 @@ open class TokenCollectorService( clock.inRange( tokenEntity.availableFrom ?: 0, tokenEntity.availableUntil ?: Long.MAX_VALUE, - clock.getTimeInSeconds(), + Instant.now().epochSecond, )