Skip to content

Commit b22888d

Browse files
authored
Merge pull request #24 from NETWAYS/fix/heartbeat-gc
Fix heartbeat ticker stopping after unsuccessful connection
2 parents 3f4c867 + 4d2475c commit b22888d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

internal/gc/gc.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ func (g *GarbageCollector) heartbeat(ctx context.Context) {
140140

141141
if errSvc != nil {
142142
g.logger.Error("Could not fetch heartbeat service from Icinga", "component", "gc", "error", errSvc.Error())
143-
return
143+
// Skip this tick, we will try next time
144+
continue
144145
}
145146

146147
action := icinga2.Action{
@@ -152,7 +153,8 @@ func (g *GarbageCollector) heartbeat(ctx context.Context) {
152153

153154
if errProcess != nil {
154155
g.logger.Error("Could not process-check-result for heartbeat", "component", "gc", "error", errProcess.Error())
155-
return
156+
// Skip this tick, we will try next time
157+
continue
156158
}
157159

158160
g.logger.Info("Successfully sent heartbeat to Icinga", "component", "gc", "service", g.serviceName)

0 commit comments

Comments
 (0)