From fe952bdba36074c1c15efd1c7459e9ac15c2112d Mon Sep 17 00:00:00 2001 From: Celestino Bellone Date: Wed, 17 Jun 2020 09:53:39 +0200 Subject: [PATCH] better naming for the synckv file name --- backend/src/main/kotlin/alfio/pi/manager/KVStore.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/kotlin/alfio/pi/manager/KVStore.kt b/backend/src/main/kotlin/alfio/pi/manager/KVStore.kt index e53db48a8..95d27ca58 100644 --- a/backend/src/main/kotlin/alfio/pi/manager/KVStore.kt +++ b/backend/src/main/kotlin/alfio/pi/manager/KVStore.kt @@ -24,7 +24,7 @@ private val logger: Logger = LoggerFactory.getLogger("alfio.pi.manager.KVStore") @Component open class KVStore(private val gson: Gson, authenticationDescriptor: RemoteApiAuthenticationDescriptor) { - private val store: SyncKV = SyncKV(synckvFileName(authenticationDescriptor.url), authenticationDescriptor.apiKey) + private val store: SyncKV = SyncKV(synckvFileName(authenticationDescriptor), authenticationDescriptor.apiKey) private val attendeeTable: SyncKVTable // @@ -352,5 +352,5 @@ private fun attendeeKey(event: String, identifier: String) = "${event}_$identifi private fun scanLogId() = System.currentTimeMillis().toString() + UUID.randomUUID().toString() -private fun synckvFileName(remoteUrl: String): String = - "alfio-pi-synckv-${Sha512DigestUtils.shaHex(remoteUrl).substring(IntRange(0, 10))}" \ No newline at end of file +private fun synckvFileName(authenticationDescriptor: RemoteApiAuthenticationDescriptor): String = + "alfio-pi-synckv-${Sha512DigestUtils.shaHex("${authenticationDescriptor.url}|${authenticationDescriptor.apiKey}").substring(IntRange(0, 10))}" \ No newline at end of file