Fix node ping interval code / default setting code
Change the place where we set the defaults for node ping and node status interval. This problem manifested itself by the node ping interval being 0 when it was set to the default. This makes two changes: 1. Invalid ping values, and ping timeouts will not allow VK to start up 2. We set the default values very early on in creation of the node controller -- where all the other values are set. Signed-off-by: Sargun Dhillon <sargun@sargun.me>
This commit is contained in:
@@ -28,6 +28,14 @@ type pingResult struct {
|
||||
}
|
||||
|
||||
func newNodePingController(node NodeProvider, pingInterval time.Duration, timeout *time.Duration) *nodePingController {
|
||||
if pingInterval == 0 {
|
||||
panic("Node ping interval is 0")
|
||||
}
|
||||
|
||||
if timeout != nil && *timeout == 0 {
|
||||
panic("Node ping timeout is 0")
|
||||
}
|
||||
|
||||
return &nodePingController{
|
||||
nodeProvider: node,
|
||||
pingInterval: pingInterval,
|
||||
|
||||
Reference in New Issue
Block a user