From 4171c1f1622257b2dfb356b59e765beda65b2f5a Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Mon, 28 Oct 2024 08:11:26 -0400 Subject: [PATCH] Revert command.go --- pkg/workceptor/command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/workceptor/command.go b/pkg/workceptor/command.go index efa6fcd6d..8d51de73c 100644 --- a/pkg/workceptor/command.go +++ b/pkg/workceptor/command.go @@ -432,9 +432,9 @@ func (cfg commandRunnerCfg) Run() error { err := commandRunner(cfg.Command, cfg.Params, cfg.UnitDir) if err != nil { statusFilename := path.Join(cfg.UnitDir, "status") - err2 := (&StatusFileData{}).UpdateBasicStatus(statusFilename, WorkStateFailed, err.Error(), stdoutSize(cfg.UnitDir)) - if err2 != nil { - MainInstance.nc.GetLogger().Error("Error updating status file %s: %s", statusFilename, err2) + err = (&StatusFileData{}).UpdateBasicStatus(statusFilename, WorkStateFailed, err.Error(), stdoutSize(cfg.UnitDir)) + if err != nil { + MainInstance.nc.GetLogger().Error("Error updating status file %s: %s", statusFilename, err) } MainInstance.nc.GetLogger().Error("Command runner exited with error: %s\n", err) os.Exit(-1)