Skip to content

Commit

Permalink
make writeableConfig a condition to write config file (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmta authored and mergify[bot] committed Nov 22, 2018
1 parent 75dad68 commit a0ba2f6
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions cmd/dsiem/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,6 @@ external message queue.`,
exit("Incorrect EPS setting", errors.New("minEPS must be <= than maxEPS"))
}

/* disable this in favor of pprof web interfae
if pp != "" {
f, err := pprof.GetProfiler(pp)
if err != nil {
exit("Cannot start profiler", err)
}
defer f.Stop()
}
*/

if traceFlag {
fo, err := ioutil.TempFile(os.TempDir(), progName+"*.trace")
if err != nil {
Expand All @@ -240,9 +230,11 @@ external message queue.`,
apm.Enable(esapm)

// saving the config for UI to read
err = viper.WriteConfigAs(path.Join(confDir, progName+"_config.json"))
if err != nil {
exit("Error writing config file", err)
if writeableConfig {
err = viper.WriteConfigAs(path.Join(confDir, progName+"_config.json"))
if err != nil {
exit("Error writing config file", err)
}
}

eventChan = make(chan event.NormalizedEvent)
Expand Down

0 comments on commit a0ba2f6

Please sign in to comment.