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.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/service/http/config.go b/service/http/config.go
index 5be42ae6..b11d807c 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -9,9 +9,6 @@ import (
// Config configures RoadRunner HTTP server.
type Config struct {
- // Enable enables http service.
- Enable bool
-
// Address and port to handle as http server.
Address string
@@ -27,21 +24,27 @@ type Config struct {
// Hydrate must populate Config values using given Config source. Must return error if Config is not valid.
func (c *Config) Hydrate(cfg service.Config) error {
- if err := cfg.Unmarshal(c); err != nil {
- return err
+ if c.Workers == nil {
+ c.Workers = &roadrunner.ServerConfig{}
}
- if !c.Enable {
- return nil
+ if c.Uploads == nil {
+ c.Uploads = &UploadsConfig{}
}
- if err := c.Valid(); err != nil {
+ c.Uploads.InitDefaults()
+ c.Workers.InitDefaults()
+
+ if err := cfg.Unmarshal(c); err != nil {
return err
}
- c.Workers.SetDefaults()
c.Workers.UpscaleDurations()
+ if err := c.Valid(); err != nil {
+ return err
+ }
+
return nil
}