Skip to content

Commit

Permalink
fix panic when close falcon connection
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchengjin committed Oct 27, 2021
1 parent e1c7d2c commit 2af2721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/FalconWriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ func (f *FalconWriter) PushToFalcon(ms []*FalconMetric) error {
}
bodyReader := bytes.NewBuffer(mb)
resp, err := http.Post(f.falconUrl, "application/json", bodyReader)
defer resp.Body.Close()

if err != nil {
f.log.Errorf("Post data to falcon failed: %s", err.Error())
return err
}

defer resp.Body.Close()
return nil
}

Expand Down

0 comments on commit 2af2721

Please sign in to comment.