feat(redis): keep services running when Redis is unreachable
Add a lazy Redis client constructor and an in-memory fallback for the refresh-session store, plus tenant-api and ops-api bootstrap that warns and continues with the lazy client instead of failing. Refresh and blacklist operations now silently fall back to the in-memory store while Redis is down so existing sessions stay valid until it recovers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,9 +90,8 @@ func New(configPath string) (*App, error) {
|
||||
|
||||
rdb, err := redis.NewClient(ctx, cfg.Redis)
|
||||
if err != nil {
|
||||
pool.Close()
|
||||
monitoringPool.Close()
|
||||
return nil, fmt.Errorf("init redis: %w", err)
|
||||
logger.Warn("redis unavailable during startup; continuing with degraded auth/cache fallback", zap.Error(err))
|
||||
rdb = redis.NewLazyClient(cfg.Redis)
|
||||
}
|
||||
|
||||
mqClient, err := rabbitmq.New(ctx, cfg.RabbitMQ)
|
||||
|
||||
Reference in New Issue
Block a user