From 97957d10b18d901fbeb31dda4072a3dc42bb940c Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Tue, 29 Oct 2024 11:36:14 -0400 Subject: [PATCH 1/3] Fix loading statusfile error checking --- pkg/workceptor/workceptor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/workceptor/workceptor.go b/pkg/workceptor/workceptor.go index 80042dbdf..e9e1bbe68 100644 --- a/pkg/workceptor/workceptor.go +++ b/pkg/workceptor/workceptor.go @@ -337,7 +337,10 @@ func (w *Workceptor) scanForUnit(unitID string) { if !ok { statusFilename := path.Join(unitdir, "status") sfd := &StatusFileData{} - _ = sfd.Load(statusFilename) + err := sfd.Load(statusFilename) + if err != nil { + w.nc.GetLogger.Error("Error loading %s: %s", statusFilename, err) + } w.workTypesLock.RLock() wt, ok := w.workTypes[sfd.WorkType] w.workTypesLock.RUnlock() From 8e8a9698f361a153d91bcfb315db7096e43d626f Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Tue, 29 Oct 2024 11:37:57 -0400 Subject: [PATCH 2/3] Fix typo --- pkg/workceptor/workceptor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/workceptor/workceptor.go b/pkg/workceptor/workceptor.go index e9e1bbe68..51fd506bb 100644 --- a/pkg/workceptor/workceptor.go +++ b/pkg/workceptor/workceptor.go @@ -339,7 +339,7 @@ func (w *Workceptor) scanForUnit(unitID string) { sfd := &StatusFileData{} err := sfd.Load(statusFilename) if err != nil { - w.nc.GetLogger.Error("Error loading %s: %s", statusFilename, err) + w.nc.GetLogger().Error("Error loading %s: %s", statusFilename, err) } w.workTypesLock.RLock() wt, ok := w.workTypes[sfd.WorkType] From c02bb02852434db5ab418d6b510482c1bb2e5e5c Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Tue, 29 Oct 2024 11:39:31 -0400 Subject: [PATCH 3/3] Another typo --- pkg/workceptor/workceptor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/workceptor/workceptor.go b/pkg/workceptor/workceptor.go index 51fd506bb..17035997c 100644 --- a/pkg/workceptor/workceptor.go +++ b/pkg/workceptor/workceptor.go @@ -337,9 +337,9 @@ func (w *Workceptor) scanForUnit(unitID string) { if !ok { statusFilename := path.Join(unitdir, "status") sfd := &StatusFileData{} - err := sfd.Load(statusFilename) - if err != nil { - w.nc.GetLogger().Error("Error loading %s: %s", statusFilename, err) + serr := sfd.Load(statusFilename) + if serr != nil { + w.nc.GetLogger().Error("Error loading %s: %s", statusFilename, serr) } w.workTypesLock.RLock() wt, ok := w.workTypes[sfd.WorkType]