summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-08 20:51:22 -0700
committerWolfy-J <[email protected]>2018-07-08 20:51:22 -0700
commit89fe2046ce3b2c22188d731d00db4917fc77d834 (patch)
tree59b8b00927189ab08d4bf2c032cc2a879a9cfe72 /service
parentdafe0c3f4877c25157b5df4ca69eb23df248ab7a (diff)
seconds can be used in config
Diffstat (limited to 'service')
-rw-r--r--service/http/config.go19
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.