summaryrefslogtreecommitdiff
path: root/service/http/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/config.go')
-rw-r--r--service/http/config.go24
1 files changed, 7 insertions, 17 deletions
diff --git a/service/http/config.go b/service/http/config.go
index 20a247fb..5be42ae6 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -5,12 +5,11 @@ import (
"github.com/spiral/roadrunner"
"github.com/spiral/roadrunner/service"
"strings"
- "time"
)
// Config configures RoadRunner HTTP server.
type Config struct {
- // Enable enables http svc.
+ // Enable enables http service.
Enable bool
// Address and port to handle as http server.
@@ -32,25 +31,16 @@ func (c *Config) Hydrate(cfg service.Config) error {
return err
}
- if err := c.Valid(); err != nil {
- return err
+ if !c.Enable {
+ return nil
}
- if c.Workers.Relay == "" {
- c.Workers.Relay = "pipes"
- }
-
- 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 err := c.Valid(); err != nil {
+ return err
}
- if c.Workers.Pool.DestroyTimeout < time.Microsecond {
- c.Workers.Pool.DestroyTimeout = time.Second * time.Duration(c.Workers.Pool.DestroyTimeout.Nanoseconds())
- }
+ c.Workers.SetDefaults()
+ c.Workers.UpscaleDurations()
return nil
}