mirror of
https://github.com/muraenateam/muraena.git
synced 2026-01-23 02:24:05 +00:00
Load Redis only when Tracking is enabled
This commit is contained in:
parent
255108dc9e
commit
3cf02b5e4c
2 changed files with 7 additions and 5 deletions
|
|
@ -36,7 +36,7 @@ func (s *Session) InitRedis() error {
|
|||
// init a new Redis db Pool
|
||||
RedisPool = newRedisPool()
|
||||
if _, err := RedisPool.Dial(); err != nil {
|
||||
return errors.New(fmt.Sprintf("%s %s", tui.Wrap(tui.BACKLIGHTBLUE, tui.Wrap(tui.FOREBLACK, "redis")), err.Error()))
|
||||
return errors.New(fmt.Sprintf("Error initializing Redis connection: %s %s", tui.Wrap(tui.BACKLIGHTBLUE, tui.Wrap(tui.FOREBLACK, "redis")), err.Error()))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -62,10 +62,12 @@ func New() (*Session, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Load Redis
|
||||
if err = s.InitRedis(); err != nil {
|
||||
log.Error("%s", err)
|
||||
return nil, err
|
||||
// Load Redis only if tracking is enabled
|
||||
if s.Config.Tracking.Enabled {
|
||||
if err = s.InitRedis(); err != nil {
|
||||
log.Error("%s", err)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
log.Info("Connected to Redis")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue