Skip to content

Commit

Permalink
Update onos-topo-module.go
Browse files Browse the repository at this point in the history
Signed-off-by: Jianwei Mao <maojianwei2016@126.com>
  • Loading branch information
MaoJianwei authored Sep 12, 2024
1 parent e231208 commit 4a43165
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions incubator/OnosTopoShow/onos-topo-module.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,13 @@ func sendRequest(method string, url string, body []byte) bool {

client := http.Client{}
resp, err := client.Do(req)
defer resp.Body.Close()

if err != nil {
util.MaoLogM(util.WARN, MODULE_NAME, "Fail to do request: %s %s, err: %s",
req.Method, req.URL.String(), err.Error())
return false
}

defer resp.Body.Close()
if resp.StatusCode != 200 {
util.MaoLogM(util.WARN, MODULE_NAME, "Fail to finish request: %s %s, http code: %d, err: %s",
req.Method, req.URL.String(), resp.StatusCode, resp.Status)
Expand Down

0 comments on commit 4a43165

Please sign in to comment.