Skip to content

Commit 506db0a

Browse files
committed
fix(sync-service): add GetRedis() accessor — resolves undefined cache.GetRedis build error
1 parent 1f97a54 commit 506db0a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎server/sync-service/cache/redis.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ func InitRedis() error {
4343
return nil
4444
}
4545

46+
// GetRedis returns the shared Redis client, or nil when Redis is unavailable.
47+
// Callers must nil-check the return value and degrade gracefully.
48+
func GetRedis() *redis.Client {
49+
return RDB
50+
}
51+
4652
// CloseRedis closes the Redis connection if it is open.
4753
func CloseRedis() {
4854
if RDB != nil {

0 commit comments

Comments
 (0)