From b9f6e64685613f44bfe43d4db367c34ae68abd63 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Thu, 16 Apr 2026 09:24:51 +0200 Subject: [PATCH] Export `GetAddrFromEnv` to allow reuse across packages --- management/server/cache/store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/management/server/cache/store.go b/management/server/cache/store.go index a4e49ecb2..2ca8e8603 100644 --- a/management/server/cache/store.go +++ b/management/server/cache/store.go @@ -34,7 +34,7 @@ const ( // NewStore creates a new cache store with the given max timeout and cleanup interval. It checks for the environment Variable RedisStoreEnvVar // to determine if a redis store should be used. If the environment variable is set, it will attempt to connect to the redis store. func NewStore(ctx context.Context, maxTimeout, cleanupInterval time.Duration, maxConn int) (store.StoreInterface, error) { - redisAddr := getAddrFromEnv() + redisAddr := GetAddrFromEnv() if redisAddr != "" { return getRedisStore(ctx, redisAddr, maxConn) } @@ -42,7 +42,8 @@ func NewStore(ctx context.Context, maxTimeout, cleanupInterval time.Duration, ma return gocache_store.NewGoCache(goc), nil } -func getAddrFromEnv() string { +// GetAddrFromEnv returns the redis address from the environment variable RedisStoreEnvVar or its legacy counterpart. +func GetAddrFromEnv() string { addr := os.Getenv(RedisStoreEnvVar) if addr == "" { addr = os.Getenv(legacyIdPCacheRedisEnvVar)