mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
fix report interval
This commit is contained in:
parent
13607c104d
commit
0ebc45e2d2
@ -74,12 +74,8 @@ func (c *Client) GetNodeInfo() (nodeInfo *NodeInfo, err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodeInfo.Routes = nil
|
nodeInfo.Routes = nil
|
||||||
if _, ok := nodeInfo.BaseConfig.PullInterval.(int); !ok {
|
nodeInfo.BaseConfig.PullInterval = intervalToTime(nodeInfo.BaseConfig.PullInterval)
|
||||||
nodeInfo.BaseConfig.PullInterval = intervalToTime(nodeInfo.BaseConfig.PullInterval)
|
nodeInfo.BaseConfig.PushInterval = intervalToTime(nodeInfo.BaseConfig.PushInterval)
|
||||||
}
|
|
||||||
if _, ok := nodeInfo.BaseConfig.PushInterval.(int); !ok {
|
|
||||||
nodeInfo.BaseConfig.PushInterval = intervalToTime(nodeInfo.BaseConfig.PullInterval)
|
|
||||||
}
|
|
||||||
c.etag = r.Header().Get("Etag")
|
c.etag = r.Header().Get("Etag")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -93,6 +89,7 @@ func intervalToTime(i interface{}) time.Duration {
|
|||||||
return time.Duration(i) * time.Second
|
return time.Duration(i) * time.Second
|
||||||
case reflect.Float64:
|
case reflect.Float64:
|
||||||
return time.Duration(i.(float64)) * time.Second
|
return time.Duration(i.(float64)) * time.Second
|
||||||
|
default:
|
||||||
|
return time.Duration(reflect.ValueOf(i).Int()) * time.Second
|
||||||
}
|
}
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user