Skip to content

Commit

Permalink
better naming for the synckv file name
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Jun 17, 2020
1 parent c6d2772 commit fe952bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/main/kotlin/alfio/pi/manager/KVStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down Expand Up @@ -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))}"
private fun synckvFileName(authenticationDescriptor: RemoteApiAuthenticationDescriptor): String =
"alfio-pi-synckv-${Sha512DigestUtils.shaHex("${authenticationDescriptor.url}|${authenticationDescriptor.apiKey}").substring(IntRange(0, 10))}"

0 comments on commit fe952bd

Please sign in to comment.