From a705e26d8012a7c7eb398ceb60a16d07ba0840e6 Mon Sep 17 00:00:00 2001 From: Tim Thompson Date: Sat, 2 Dec 2023 11:25:38 -0800 Subject: [PATCH] fixes from palette10 --- kit/engine.go | 9 +-------- kit/nats.go | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/kit/engine.go b/kit/engine.go index b083672a..a97f8d46 100644 --- a/kit/engine.go +++ b/kit/engine.go @@ -49,6 +49,7 @@ func InitMisc() { } TheProcessManager = NewProcessManager() + TheProcessManager.AddBuiltins() // Fixed rand sequence, better for testing TheRand = rand.New(rand.NewSource(1)) @@ -96,8 +97,6 @@ func InitEngine() { LogIfError(err) TheAttractManager.SetAttractEnabled(enabled) - TheProcessManager.AddBuiltins() - CheckAutorestartProcesses() nats, err := GetParamBool("global.nats") @@ -130,16 +129,10 @@ func WaitTillDone() { } func GetParam(name string) (string, error) { - if TheEngine == nil { - return "", fmt.Errorf("GetParam called before NewEngine, name=%s)", name) - } return GlobalParams.Get(name) } func GetParamWithDefault(name string, dflt string) string { - if TheEngine == nil { - return "" - } val, err := GlobalParams.Get(name) if err != nil { val = dflt diff --git a/kit/nats.go b/kit/nats.go index b23116ad..af737b46 100644 --- a/kit/nats.go +++ b/kit/nats.go @@ -184,9 +184,9 @@ func (vn *VizNats) Request(subj, data string, timeout time.Duration) (retdata st bytes := []byte(data) msg, err := nc.Request(subj, bytes, timeout) if err == nats.ErrTimeout { - return "", fmt.Errorf("Timeout, nothing is subscribed to subj=%s", subj) + return "", fmt.Errorf("timeout, nothing is subscribed to subj=%s", subj) } else if err != nil { - return "", fmt.Errorf("Error: subj=%s err=%s", subj, err) + return "", fmt.Errorf("error: subj=%s err=%s", subj, err) } return string(msg.Data), nil }