Skip to content

Commit

Permalink
Eksperiment: Legg til Redis-brukernavn
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga committed Jan 16, 2025
1 parent 82e6e92 commit d4ca932
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fun main() {
Env.Redis.aivenHost,
Env.Redis.aivenPassword,
Env.Redis.aivenPort,
Env.Redis.aivenUsername,
)
val redisConnection = RedisConnection(Env.Redis.url)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ object Env {
val aivenHost: String = "REDIS_HOST_INNTEKTSMELDING".fromEnv()
val aivenPassword: String = "REDIS_PASSWORD_INNTEKTSMELDING".fromEnv()
val aivenPort: String = "REDIS_PORT_INNTEKTSMELDING".fromEnv()
val aivenUsername: String = "REDIS_USERNAME_INNTEKTSMELDING".fromEnv()

// val aivenUri: String = "REDIS_URI_INNTEKTSMELDING".fromEnv()
val url: String = "REDIS_URL".fromEnv()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class RedisConnection(
aivenHost: String,
aivenPassword: String,
aivenPort: String,
) : this("rediss://$aivenPassword@$aivenHost:$aivenPort/0")
aivenUsername: String,
) : this("rediss://$aivenUsername:$aivenPassword@$aivenHost:$aivenPort/0")

private val client: RedisClient = RedisClient.create(redisUri)
private val connection: StatefulRedisConnection<String, String> = client.connect()
Expand Down

0 comments on commit d4ca932

Please sign in to comment.