Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from spiral/pr/config-defaults-rewrite
Browse files Browse the repository at this point in the history
Update config.go
  • Loading branch information
wolfy-j authored Apr 25, 2019
2 parents aebee97 + f84dff4 commit 0c9b5ab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ type Config struct {

// Hydrate populates config values.
func (c *Config) Hydrate(cfg service.Config) (err error) {
if err := cfg.Unmarshal(&c); err != nil {
return err
c.parent = cfg

if c.Workers == nil {
c.Workers = &roadrunner.ServerConfig{}
}
c.Workers.InitDefaults()

c.parent = cfg
if c.Workers != nil {
c.Workers.InitDefaults()
if err := cfg.Unmarshal(&c); err != nil {
return err
}

c.pipelines, err = initPipelines(c.Pipelines)
Expand Down

0 comments on commit 0c9b5ab

Please sign in to comment.