diff options
Diffstat (limited to 'plugins/jobs/drivers/beanstalk/config.go')
-rw-r--r-- | plugins/jobs/drivers/beanstalk/config.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/jobs/drivers/beanstalk/config.go b/plugins/jobs/drivers/beanstalk/config.go index f0012362..a8069f5d 100644 --- a/plugins/jobs/drivers/beanstalk/config.go +++ b/plugins/jobs/drivers/beanstalk/config.go @@ -1,6 +1,10 @@ package beanstalk -import "time" +import ( + "time" + + "github.com/spiral/roadrunner/v2/utils" +) const ( tubePriority string = "tube_priority" @@ -15,7 +19,7 @@ type GlobalCfg struct { func (c *GlobalCfg) InitDefault() { if c.Addr == "" { - c.Addr = "tcp://localhost:11300" + c.Addr = "tcp://127.0.0.1:11300" } if c.Timeout == 0 { @@ -25,7 +29,7 @@ func (c *GlobalCfg) InitDefault() { type Config struct { PipePriority int64 `mapstructure:"priority"` - TubePriority uint32 `mapstructure:"tube_priority"` + TubePriority *uint32 `mapstructure:"tube_priority"` Tube string `mapstructure:"tube"` ReserveTimeout time.Duration `mapstructure:"reserve_timeout"` } @@ -39,6 +43,10 @@ func (c *Config) InitDefault() { c.ReserveTimeout = time.Second * 1 } + if c.TubePriority == nil { + c.TubePriority = utils.Uint32(0) + } + if c.PipePriority == 0 { c.PipePriority = 10 } |