Skip to content

Commit

Permalink
Merge pull request #34 from DevKhaverko/fix
Browse files Browse the repository at this point in the history
not shutdown netreap after getting incorrect event from nomad
  • Loading branch information
protochron authored Feb 2, 2024
2 parents 8c6edb4 + 2134797 commit 5e4cc27
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions reapers/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package reapers

import (
"context"
"encoding/json"
"fmt"
"math"
"sort"
Expand Down Expand Up @@ -83,9 +84,13 @@ func (e *EndpointReaper) Run(ctx context.Context) (<-chan bool, error) {

case events := <-eventChan:
if events.Err != nil {
zap.L().Debug("Got error message from node event channel", zap.Error(events.Err))
failChan <- true
return
if _, ok := err.(*json.SyntaxError); ok {
zap.L().Debug("Got incorrect event from nomad", zap.Error(events.Err))
} else {
zap.L().Debug("Got error message from node event channel", zap.Error(events.Err))
failChan <- true
return
}
}

zap.L().Debug("Got events from Allocation topic. Handling...", zap.Int("event-count", len(events.Events)))
Expand Down

0 comments on commit 5e4cc27

Please sign in to comment.