summaryrefslogtreecommitdiff
path: root/server_config.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-06 15:55:28 +0300
committerWolfy-J <[email protected]>2018-06-06 15:55:28 +0300
commite863c6cdcf7c318fb251e096bf92812ed98ea03c (patch)
tree9eb2cd049dfae0482211a6a212d28cc48304f109 /server_config.go
parent67b88c9914d922314ce7cd8d3624d64812647758 (diff)
better server re-configuration
Diffstat (limited to 'server_config.go')
-rw-r--r--server_config.go12
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