Skip to content

Commit

Permalink
remove os.Exit from engine.Stop
Browse files Browse the repository at this point in the history
  • Loading branch information
atterpac committed Jan 16, 2024
1 parent 442ab70 commit 96a74d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ type Config struct {
}

// Reads a config.toml file and returns the engine
func (engine *Engine) readConfigFile(path string) *Engine {
func (engine *Engine) readConfigFile(path string) *Engine{
if _, err := toml.DecodeFile(path, &engine); err != nil {
slog.Error("Error reading config file")
slog.Error(err.Error())
os.Exit(1)
}
return engine
}
Expand All @@ -41,13 +40,11 @@ func (engine *Engine) readConfigYaml(path string) *Engine {
if err != nil {
slog.Error("Error reading config file")
slog.Error(err.Error())
os.Exit(1)
}
err = yaml.Unmarshal(file, &engine)
if err != nil {
slog.Error("Error reading config file")
slog.Error(err.Error())
os.Exit(1)
}
return engine
}
Expand Down
1 change: 0 additions & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (engine *Engine) SigTrap(ch chan error) {
func (engine *Engine) Stop() {
engine.killProcess(engine.ProcessTree)
notify.Stop(engine.Chan)
os.Exit(0)
}

func (engine *Engine) SetLogger(logger *slog.Logger) {
Expand Down

0 comments on commit 96a74d7

Please sign in to comment.