diff options
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 |