Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Nov 15, 2024
1 parent d14d88d commit 17f2e17
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/app/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/centrifugal/centrifugo/v5/internal/confighelpers"
"github.com/centrifugal/centrifugo/v5/internal/natsbroker"
"github.com/centrifugal/centrifugo/v5/internal/redisnatsbroker"
"github.com/centrifugal/centrifugo/v5/internal/service"

"github.com/centrifugal/centrifuge"
"github.com/rs/zerolog/log"
Expand All @@ -19,7 +18,7 @@ type engineModes struct {
presenceManagerMode string
}

func configureEngines(node *centrifuge.Node, cfgContainer *config.Container, serviceManager *service.Manager) (engineModes, error) {
func configureEngines(node *centrifuge.Node, cfgContainer *config.Container) (engineModes, error) {
cfg := cfgContainer.Config()

var modes engineModes
Expand All @@ -33,7 +32,7 @@ func configureEngines(node *centrifuge.Node, cfgContainer *config.Container, ser
case "memory":
broker, presenceManager, err = createMemoryEngine(node)
case "redis":
broker, presenceManager, modes.engineMode, err = createRedisEngine(node, cfgContainer, serviceManager)
broker, presenceManager, modes.engineMode, err = createRedisEngine(node, cfgContainer)
default:
return modes, fmt.Errorf("unknown engine type: %s", cfg.Engine.Type)
}
Expand Down Expand Up @@ -98,7 +97,7 @@ func configureEngines(node *centrifuge.Node, cfgContainer *config.Container, ser
case "memory":
presenceManager, err = createMemoryPresenceManager(node)
case "redis":
presenceManager, modes.presenceManagerMode, err = createRedisPresenceManager(node, cfgContainer, serviceManager)
presenceManager, modes.presenceManagerMode, err = createRedisPresenceManager(node, cfgContainer)
default:
return modes, fmt.Errorf("unknown presence manager type: %s", cfg.PresenceManager.Type)
}
Expand Down Expand Up @@ -163,7 +162,7 @@ func NatsBroker(node *centrifuge.Node, cfg config.Config) (*natsbroker.NatsBroke
return natsbroker.New(node, cfg.Broker.Nats)
}

func createRedisEngine(n *centrifuge.Node, cfgContainer *config.Container, _ *service.Manager) (*centrifuge.RedisBroker, centrifuge.PresenceManager, string, error) {
func createRedisEngine(n *centrifuge.Node, cfgContainer *config.Container) (*centrifuge.RedisBroker, centrifuge.PresenceManager, string, error) {
cfg := cfgContainer.Config()
redisShards, mode, err := confighelpers.CentrifugeRedisShards(n, cfg.Broker.Redis.Redis)
if err != nil {
Expand Down Expand Up @@ -203,7 +202,7 @@ func createRedisBroker(n *centrifuge.Node, cfgContainer *config.Container) (*cen
return broker, mode, nil
}

func createRedisPresenceManager(n *centrifuge.Node, cfgContainer *config.Container, _ *service.Manager) (centrifuge.PresenceManager, string, error) {
func createRedisPresenceManager(n *centrifuge.Node, cfgContainer *config.Container) (centrifuge.PresenceManager, string, error) {
cfg := cfgContainer.Config()
redisShards, mode, err := confighelpers.CentrifugeRedisShards(n, cfg.PresenceManager.Redis.Redis)
if err != nil {
Expand Down

0 comments on commit 17f2e17

Please sign in to comment.