mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-08 16:31:07 +02:00
Fix unnecessary conversions
This commit is contained in:
parent
19a5b1a31c
commit
4d1fc8d6ec
@ -722,7 +722,7 @@ func (nsc *NetworkServicesController) publishMetrics(serviceInfoMap serviceInfoM
|
|||||||
endTime := time.Since(start)
|
endTime := time.Since(start)
|
||||||
glog.V(2).Infof("Publishing IPVS metrics took %v", endTime)
|
glog.V(2).Infof("Publishing IPVS metrics took %v", endTime)
|
||||||
if nsc.MetricsEnabled {
|
if nsc.MetricsEnabled {
|
||||||
metrics.ControllerIpvsMetricsExportTime.Observe(float64(endTime.Seconds()))
|
metrics.ControllerIpvsMetricsExportTime.Observe(endTime.Seconds())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ func (hc *HealthController) HandleHeartbeat(beat *ControllerHeartbeat) {
|
|||||||
// CheckHealth evaluates the time since last heartbeat to decide if the controller is running or not
|
// CheckHealth evaluates the time since last heartbeat to decide if the controller is running or not
|
||||||
func (hc *HealthController) CheckHealth() bool {
|
func (hc *HealthController) CheckHealth() bool {
|
||||||
health := true
|
health := true
|
||||||
graceTime := time.Duration(1500 * time.Millisecond)
|
graceTime := time.Duration(1500) * time.Millisecond
|
||||||
|
|
||||||
if hc.Config.RunFirewall {
|
if hc.Config.RunFirewall {
|
||||||
if time.Since(hc.Status.NetworkPolicyControllerAlive) > hc.Config.IPTablesSyncPeriod+hc.Status.NetworkPolicyControllerAliveTTL+graceTime {
|
if time.Since(hc.Status.NetworkPolicyControllerAlive) > hc.Config.IPTablesSyncPeriod+hc.Status.NetworkPolicyControllerAliveTTL+graceTime {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user