Merge pull request #3 from jason-gao/master
fix:callback url request fail error deal
This commit is contained in:
commit
4d0bc0886d
10
notifer.go
10
notifer.go
@ -62,7 +62,15 @@ func (n *NetNotifier) dispatch(params *postParams) {
|
||||
req.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
||||
req.Header.Set("User-Agent", "FileBoy Net Notifier v1.5")
|
||||
resp, err := client.Do(req)
|
||||
defer resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Println("notifier call failed. err:", err)
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
if resp != nil && resp.Body != nil {
|
||||
_ = resp.Body.Close()
|
||||
}
|
||||
}()
|
||||
if resp.StatusCode >= 300 {
|
||||
// todo retry???
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user