diff options
author | Wolfy-J <[email protected]> | 2018-09-10 14:28:15 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-09-10 14:28:15 +0300 |
commit | ceb5033d5bb2fb641c886d4010f05498552152c2 (patch) | |
tree | 5f5669d863a66a2e527ab0a51ede412e05a4cb16 /service/http/config.go | |
parent | 569a0dec066ea53fd6d0a2080362db67fd794557 (diff) |
minor config improvements
Diffstat (limited to 'service/http/config.go')
-rw-r--r-- | service/http/config.go | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/service/http/config.go b/service/http/config.go index a15edb35..2cfe1ba2 100644 --- a/service/http/config.go +++ b/service/http/config.go @@ -5,7 +5,6 @@ import ( "github.com/spiral/roadrunner" "github.com/spiral/roadrunner/service" "strings" - "time" ) // Config configures RoadRunner HTTP server. @@ -36,30 +35,13 @@ func (c *Config) Hydrate(cfg service.Config) error { return nil } + c.Workers.SetDefaults() + c.Workers.UpscaleDurations() + if err := c.Valid(); err != nil { return err } - if c.Workers.Relay == "" { - c.Workers.Relay = "pipes" - } - - c.Workers.MountDefaults() - - // nanosecond to second conversion - - if c.Workers.RelayTimeout < time.Microsecond { - c.Workers.RelayTimeout = time.Second * time.Duration(c.Workers.RelayTimeout.Nanoseconds()) - } - - if c.Workers.Pool.AllocateTimeout < time.Microsecond { - c.Workers.Pool.AllocateTimeout = time.Second * time.Duration(c.Workers.Pool.AllocateTimeout.Nanoseconds()) - } - - if c.Workers.Pool.DestroyTimeout < time.Microsecond { - c.Workers.Pool.DestroyTimeout = time.Second * time.Duration(c.Workers.Pool.DestroyTimeout.Nanoseconds()) - } - return nil } |