Skip to content

Commit

Permalink
[chore] revive lint on host and check context error
Browse files Browse the repository at this point in the history
  • Loading branch information
tbelda-ems committed Sep 9, 2023
1 parent 3d07080 commit a25130a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/vccollector/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (c *VcCollector) CollectHostInfo(

acc.AddFields("vcstat_host", hsfields, hstags, t)
}
if err = ctx.Err(); err != nil {
return err
}
}
}

Expand Down Expand Up @@ -190,6 +193,9 @@ func (c *VcCollector) CollectHostHBA(
hostSt.setNotResponding(true)
return fmt.Errorf("slow response from %s: %w", host.Name(), context.DeadlineExceeded)
}
if err = ctx.Err(); err != nil {
return err
}
}
}

Expand Down Expand Up @@ -270,6 +276,9 @@ func (c *VcCollector) CollectHostNIC(
hostSt.setNotResponding(true)
return fmt.Errorf("slow response from %s: %w", host.Name(), context.DeadlineExceeded)
}
if err = ctx.Err(); err != nil {
return err
}
}
}

Expand Down Expand Up @@ -353,6 +362,9 @@ func (c *VcCollector) CollectHostFw(
hostSt.setNotResponding(true)
return fmt.Errorf("slow response from %s: %w", host.Name(), context.DeadlineExceeded)
}
if err = ctx.Err(); err != nil {
return err
}
}
}

Expand Down Expand Up @@ -443,6 +455,9 @@ func (c *VcCollector) CollectHostServices(
acc.AddFields("vcstat_host_service", hsfields, hstags, t)
}
}
if err = ctx.Err(); err != nil {
return err
}
}
}

Expand All @@ -460,6 +475,7 @@ func (c *VcCollector) ReportHostEsxcliResponse(
hostSt *hostState
t time.Time
z time.Duration
err error
respondingCode int
)

Expand Down Expand Up @@ -495,6 +511,9 @@ func (c *VcCollector) ReportHostEsxcliResponse(

acc.AddFields("vcstat_host_esxcli", hsfields, hstags, t)
}
if err = ctx.Err(); err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit a25130a

Please sign in to comment.