From 5f7bcc4eb5021cd2890df4ad6fa53016360a228e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 22 Apr 2016 15:34:53 +0000 Subject: [PATCH] really skip scaling if equal --- handler/lib.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/handler/lib.go b/handler/lib.go index 9e9b4d4..8b998d7 100644 --- a/handler/lib.go +++ b/handler/lib.go @@ -1,15 +1,16 @@ package handler import ( - "git.higgsboson.tk/Mic92/kapacitor-scale/scaling" "errors" "fmt" - "github.com/influxdata/kapacitor/udf" - "github.com/influxdata/kapacitor/udf/agent" - "github.com/pk-rawat/gostr/src" "log" "strconv" "time" + + "git.higgsboson.tk/Mic92/kapacitor-scale/scaling" + "github.com/influxdata/kapacitor/udf" + "github.com/influxdata/kapacitor/udf/agent" + "github.com/pk-rawat/gostr/src" ) type Handler struct { @@ -193,6 +194,7 @@ func (h *Handler) Point(p *udf.Point) error { } if to == service.CurrentInstances { h.debug("skip scaling service '%s' still %d", h.Id, to) + return nil } h.debug("attempt to scale service '%s' from %d to %d", h.Id, service.CurrentInstances, to) if !h.Simulate {