diff options
author | Wolfy-J <[email protected]> | 2018-07-08 20:51:22 -0700 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-07-08 20:51:22 -0700 |
commit | 89fe2046ce3b2c22188d731d00db4917fc77d834 (patch) | |
tree | 59b8b00927189ab08d4bf2c032cc2a879a9cfe72 /service | |
parent | dafe0c3f4877c25157b5df4ca69eb23df248ab7a (diff) |
seconds can be used in config
Diffstat (limited to 'service')
-rw-r--r-- | service/http/config.go | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/service/http/config.go b/service/http/config.go index e46b56cf..ebdd0343 100644 --- a/service/http/config.go +++ b/service/http/config.go @@ -5,6 +5,7 @@ import ( "github.com/spiral/roadrunner" "strings" "github.com/spiral/roadrunner/service" + "time" ) // Config configures RoadRunner HTTP server. @@ -31,7 +32,23 @@ func (c *Config) Hydrate(cfg service.Config) error { return err } - return c.Valid() + if err := c.Valid(); err != nil { + return err + } + + 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 } // Valid validates the configuration. |