fix: case1: GResponse is nil

change: actives.yaml restart to 65s
This commit is contained in:
huangsimin 2018-12-17 11:07:30 +08:00
parent 6d4c94e49e
commit 0490f5124b
2 changed files with 5 additions and 2 deletions

View File

@ -20,4 +20,4 @@ switch:
192.168.6.100:8091:
group: ["10.10.10.92", "10.10.10.93"] # 三亚
city: "4602"
restart: 50
restart: 65

5
dip.go
View File

@ -77,7 +77,10 @@ func (group *DIPGroup) Choose(addr string) {
if resp, err := requests.NewSession().Get(restartAddr).Execute(); err != nil {
log.Println(err)
group.Current.ActiveTime += 12
defer resp.GResponse.Body.Close()
if resp.GResponse != nil {
defer resp.GResponse.Body.Close()
}
} else {
defer resp.GResponse.Body.Close()
group.Current = dhost