diff options
author | Wolfy-J <[email protected]> | 2018-06-06 15:55:28 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-06 15:55:28 +0300 |
commit | e863c6cdcf7c318fb251e096bf92812ed98ea03c (patch) | |
tree | 9eb2cd049dfae0482211a6a212d28cc48304f109 /server_config.go | |
parent | 67b88c9914d922314ce7cd8d3624d64812647758 (diff) |
better server re-configuration
Diffstat (limited to 'server_config.go')
-rw-r--r-- | server_config.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server_config.go b/server_config.go index 72585e06..1491e833 100644 --- a/server_config.go +++ b/server_config.go @@ -44,6 +44,18 @@ type ServerConfig struct { Pool *Config } +// Differs returns true if configuration has changed but ignores pool changes. +func (cfg *ServerConfig) Differs(new *ServerConfig) bool { + // command configuration has changed + if cfg.Command != new.Command || cfg.User != new.User || cfg.Group != new.Group { + return true + } + + // factory configuration has changed + return cfg.Relay != new.Relay || cfg.FactoryTimeout != new.FactoryTimeout +} + +// makeCommands returns new command provider based on configured options. func (cfg *ServerConfig) makeCommand() (func() *exec.Cmd, error) { var ( err error |