summaryrefslogtreecommitdiff
path: root/server_config.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 14:52:55 +0300
committerWolfy-J <[email protected]>2018-09-23 14:52:55 +0300
commit19d88fc879ba403347726138eb532fb85d38168e (patch)
treec93c9ddd7a6fe7be3b884458b3ad8e9f4c9b19ec /server_config.go
parentbd046974b969af381b3a50513d9f3ab453ed8bbf (diff)
default configs
Diffstat (limited to 'server_config.go')
-rw-r--r--server_config.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/server_config.go b/server_config.go
index e2f9266b..b2d8845b 100644
--- a/server_config.go
+++ b/server_config.go
@@ -33,8 +33,8 @@ type ServerConfig struct {
env []string
}
-// SetDefaults sets missing values to their default values.
-func (cfg *ServerConfig) SetDefaults() {
+// InitDefaults sets missing values to their default values.
+func (cfg *ServerConfig) InitDefaults() error {
if cfg.Relay == "" {
cfg.Relay = "pipes"
}
@@ -47,13 +47,7 @@ func (cfg *ServerConfig) SetDefaults() {
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.