mirror of
https://github.com/nais/wonderwall.git
synced 2026-05-08 09:27:12 +00:00
refactor: remove startup redis ping
This commit is contained in:
@@ -69,16 +69,11 @@ func run() error {
|
||||
var sessionStore session.Store
|
||||
if len(cfg.Redis) > 0 {
|
||||
redisClient := redis.NewClient(&redis.Options{
|
||||
Network: "tcp",
|
||||
Addr: cfg.Redis,
|
||||
Network: "tcp",
|
||||
Addr: cfg.Redis,
|
||||
MaxRetries: 10,
|
||||
})
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
if err := redisClient.Ping(ctx).Err(); err != nil {
|
||||
return fmt.Errorf("connecting to redis: %w", err)
|
||||
}
|
||||
|
||||
sessionStore = session.NewRedis(redisClient)
|
||||
log.Infof("Using Redis as session backing store")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user