Skip to content

Commit

Permalink
Fix worker redis address configuration mapping bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
urionz committed Jun 13, 2024
1 parent ee04f5b commit 4984011
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ func newDefaultClusterSDConfig() *ClusterSDConfig {
// WorkerConfig provides worker configuration
type WorkerConfig struct {
Redis struct {
ServerURL string `mapstructure:"serverurl"`
Pool string `mapstructure:"pool"`
Password string `mapstructure:"password"`
Address string `mapstructure:"address"`
Pool string `mapstructure:"pool"`
Password string `mapstructure:"password"`
} `mapstructure:"redis"`
Namespace string `mapstructure:"namespace"`
Concurrency int `mapstructure:"concurrency"`
Expand All @@ -474,12 +474,12 @@ type WorkerConfig struct {
func newDefaultWorkerConfig() *WorkerConfig {
return &WorkerConfig{
Redis: struct {
ServerURL string `mapstructure:"serverurl"`
Pool string `mapstructure:"pool"`
Password string `mapstructure:"password"`
Address string `mapstructure:"address"`
Pool string `mapstructure:"pool"`
Password string `mapstructure:"password"`
}{
ServerURL: "localhost:6379",
Pool: "10",
Address: "localhost:6379",
Pool: "10",
},
Concurrency: 1,
Retry: *newDefaultEnqueueOpts(),
Expand Down
2 changes: 1 addition & 1 deletion config/viper_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *Config) fillDefaultValues() {
"pitaya.session.drain.period": pitayaConfig.Session.Drain.Period,
"pitaya.worker.concurrency": pitayaConfig.Worker.Concurrency,
"pitaya.worker.redis.pool": pitayaConfig.Worker.Redis.Pool,
"pitaya.worker.redis.url": pitayaConfig.Worker.Redis.ServerURL,
"pitaya.worker.redis.address": pitayaConfig.Worker.Redis.Address,
"pitaya.worker.redis.password": pitayaConfig.Worker.Redis.Password,
"pitaya.worker.retry.enabled": pitayaConfig.Worker.Retry.Enabled,
"pitaya.worker.retry.exponential": pitayaConfig.Worker.Retry.Exponential,
Expand Down
2 changes: 1 addition & 1 deletion worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewWorker(config config.WorkerConfig, opts config.EnqueueOpts) (*Worker, er
}

workers.Configure(workers.Options{
Address: config.Redis.ServerURL,
Address: config.Redis.Address,
Password: config.Redis.Password,
Namespace: config.Namespace,
ProcessID: hostname,
Expand Down

0 comments on commit 4984011

Please sign in to comment.