Skip to content

Commit

Permalink
fix review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aajkl committed Jul 1, 2024
1 parent a636e1f commit 8d4ddfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/eru/agent/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (m *Manager) nodeStatusReport(ctx context.Context) {
return
}
if err := m.store.CheckHealth(ctx); err != nil {
logger.Error(ctx, err, "failed to check health of core")
m.mCol.coreHealthy.Store(false)
} else {
m.mCol.coreHealthy.Store(true)
Expand Down
7 changes: 3 additions & 4 deletions internal/eru/agent/workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ func (m *Manager) checkAllWorkloads(ctx context.Context) {
return
}

for _, workloadID := range workloadIDs {
ID := workloadID
_ = utils.Pool.Submit(func() { m.checkOneWorkload(ctx, ID) })
for _, wrkID := range workloadIDs {
_ = utils.Pool.Submit(func() { m.checkOneWorkload(ctx, wrkID) })
}
}

Expand All @@ -157,7 +156,7 @@ func (m *Manager) checkOneWorkload(ctx context.Context, ID string) bool {

m.wrkStatusCache.Set(workloadStatus.ID, workloadStatus, 0)

if err = m.setWorkloadStatus(ctx, workloadStatus); err != nil {
if err := m.setWorkloadStatus(ctx, workloadStatus); err != nil {
logger.Error(ctx, err, "update workload status failed")
}
return workloadStatus.Healthy
Expand Down

0 comments on commit 8d4ddfe

Please sign in to comment.