Skip to content

Commit

Permalink
fixes from palette10
Browse files Browse the repository at this point in the history
  • Loading branch information
vizicist committed Dec 2, 2023
1 parent 01ccf5b commit a705e26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions kit/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func InitMisc() {
}

TheProcessManager = NewProcessManager()
TheProcessManager.AddBuiltins()

// Fixed rand sequence, better for testing
TheRand = rand.New(rand.NewSource(1))
Expand Down Expand Up @@ -96,8 +97,6 @@ func InitEngine() {
LogIfError(err)
TheAttractManager.SetAttractEnabled(enabled)

TheProcessManager.AddBuiltins()

CheckAutorestartProcesses()

nats, err := GetParamBool("global.nats")
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions kit/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a705e26

Please sign in to comment.