Skip to content

Commit

Permalink
Add return to response error check condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Luis Lucas authored and iknite committed Dec 18, 2018
1 parent 10ae548 commit 5b7dcb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gossip/auditor/auditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ func (t MembershipTask) Do() {
}

func (t MembershipTask) sendAlert(msg string) {
resp, err := http.Post(fmt.Sprintf("%s/alert", t.pubUrl), "application/json", bytes.NewBufferString(msg))
resp, err := http.Post(fmt.Sprintf("%s/alert", t.pubUrl), "application/json",
bytes.NewBufferString(msg))
if err != nil {
log.Infof("Error saving batch in alertStore: %v", err)
return
}
defer resp.Body.Close()
_, err = io.Copy(ioutil.Discard, resp.Body)
Expand Down
1 change: 1 addition & 0 deletions gossip/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (m Monitor) sendAlert(msg string) {
bytes.NewBufferString(msg))
if err != nil {
log.Infof("Error saving batch in alertStore: %v", err)
return
}
defer resp.Body.Close()
_, err = io.Copy(ioutil.Discard, resp.Body)
Expand Down
1 change: 1 addition & 0 deletions gossip/publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (p Publisher) executeTask(task PublishTask) {
"application/json", bytes.NewBuffer(buf))
if err != nil {
log.Infof("Error saving batch in snapStore: %v\n", err)
return
}
defer resp.Body.Close()
_, err = io.Copy(ioutil.Discard, resp.Body)
Expand Down

0 comments on commit 5b7dcb1

Please sign in to comment.