From 24bf6cffc348968da9c7613bc32e25ff5a91f652 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 26 Dec 2024 11:55:31 -0500 Subject: [PATCH] [M] Rename --- .../icu/samnyan/aqua/sega/allnet/KeychipSession.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/icu/samnyan/aqua/sega/allnet/KeychipSession.kt b/src/main/java/icu/samnyan/aqua/sega/allnet/KeychipSession.kt index 615f8f6c..7927c737 100644 --- a/src/main/java/icu/samnyan/aqua/sega/allnet/KeychipSession.kt +++ b/src/main/java/icu/samnyan/aqua/sega/allnet/KeychipSession.kt @@ -54,7 +54,7 @@ interface KeychipSessionRepo : JpaRepository { @Service class KeychipSessionService( - val keychipSessionRepo: KeychipSessionRepo, + val repo: KeychipSessionRepo, val props: AllNetProps ) { val logger = LoggerFactory.getLogger(KeychipSessionService::class.java) @@ -66,7 +66,7 @@ class KeychipSessionService( suspend fun cleanup() = async { logger.info("!!! Keychip session cleanup !!!") val expire = System.currentTimeMillis() - props.keychipSesExpire - keychipSessionRepo.deleteAllByLastUseBefore(expire) + repo.deleteAllByLastUseBefore(expire) } /** @@ -74,14 +74,14 @@ class KeychipSessionService( */ fun new(user: AquaNetUser?, gameId: String): KeychipSession { val session = KeychipSession(user = user, gameId = gameId) - return keychipSessionRepo.save(session) + return repo.save(session) } /** * Find a session. If found, renew the last use time. */ - fun find(token: String) = keychipSessionRepo.findByToken(token)?.apply { + fun find(token: String) = repo.findByToken(token)?.apply { lastUse = System.currentTimeMillis() - keychipSessionRepo.save(this) + repo.save(this) } }