From 25f3cb60cbbc37e6692a7b6b88ba35314c4f7283 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Tue, 3 Aug 2021 16:26:25 -0600 Subject: [PATCH] server: actually use StartOnCompletion and CrashDetectionEnabled --- server/update.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/update.go b/server/update.go index cfbdfed..7a1eb2e 100644 --- a/server/update.go +++ b/server/update.go @@ -86,6 +86,24 @@ func (s *Server) UpdateDataStructure(data []byte) error { c.SkipEggScripts = v } + if v, err := jsonparser.GetBoolean(data, "start_on_completion"); err != nil { + if err != jsonparser.KeyPathNotFoundError { + return errors.WithStack(err) + } + } else { + c.StartOnCompletion = v + } + + if v, err := jsonparser.GetBoolean(data, "crash_detection_enabled"); err != nil { + if err != jsonparser.KeyPathNotFoundError { + return errors.WithStack(err) + } + // Enable crash detection by default. + c.CrashDetectionEnabled = true + } else { + c.CrashDetectionEnabled = v + } + // Environment and Mappings should be treated as a full update at all times, never a // true patch, otherwise we can't know what we're passing along. if src.EnvVars != nil && len(src.EnvVars) > 0 {