summaryrefslogtreecommitdiff
path: root/server_config.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 15:55:57 +0300
committerGitHub <[email protected]>2018-09-23 15:55:57 +0300
commit6628249e68a85e6c2fed6d5802fa247388b053dc (patch)
treedef759b509dbd32569afc8229c8888fa6599e1bf /server_config.go
parentbdff4b25d2a879357bc0ed53e96c0b551de07f88 (diff)
parenteb64ebee3c77522202c5163513e7318bd630f8be (diff)
Merge pull request #37 from spiral/feature/1.3.0
Feature/1.3.0
Diffstat (limited to 'server_config.go')
-rw-r--r--server_config.go21
1 files changed, 5 insertions, 16 deletions
diff --git a/server_config.go b/server_config.go
index e2f9266b..936744a1 100644
--- a/server_config.go
+++ b/server_config.go
@@ -33,27 +33,16 @@ type ServerConfig struct {
env []string
}
-// SetDefaults sets missing values to their default values.
-func (cfg *ServerConfig) SetDefaults() {
- if cfg.Relay == "" {
- cfg.Relay = "pipes"
- }
-
- if cfg.RelayTimeout == 0 {
- cfg.RelayTimeout = time.Minute
- }
+// InitDefaults sets missing values to their default values.
+func (cfg *ServerConfig) InitDefaults() error {
+ cfg.Relay = "pipes"
+ cfg.RelayTimeout = time.Minute
if cfg.Pool == nil {
cfg.Pool = &Config{}
}
- if cfg.Pool.AllocateTimeout == 0 {
- cfg.Pool.AllocateTimeout = time.Minute
- }
-
- if cfg.Pool.DestroyTimeout == 0 {
- cfg.Pool.DestroyTimeout = time.Minute
- }
+ return cfg.Pool.InitDefaults()
}
// UpscaleDurations converts duration values from nanoseconds to seconds.