Skip to content

Commit

Permalink
Move the place of scaler.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
TsuyoshiUshio committed Jul 23, 2020
1 parent 3576d2f commit 9c47512
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/metrics v0.18.0/go.mod h1:8aYTW18koXqjLVKL7Ds05RPMX9ipJZI3mywYvBOxXd4=
k8s.io/metrics v0.18.2 h1:v4J7WKu/Zo/htSH3w//UWJZT9/CpUThXWYyUbQ/F/jY=
k8s.io/metrics v0.18.2/go.mod h1:qga8E7QfYNR9Q89cSCAjinC9pTZ7yv1XSVGUB0vJypg=
k8s.io/metrics v0.18.6 h1:IRMCn0KKNhbOSnxNZ+MhooRi8c67iIMjpGkKpm6oqOM=
k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
Expand Down
3 changes: 2 additions & 1 deletion pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (h *scaleHandler) checkScaledJobScalers(ctx context.Context, scalers []scal
scalerLogger := h.logger.WithValues("Scaler", scaler)

isTriggerActive, err := scaler.IsActive(ctx)
// scaler.Close() // TODO why does it closes?

scalerLogger.Info("Active trigger", "isTriggerActive", isTriggerActive)
metricSpecs := scaler.GetMetricSpecForScaling()

Expand Down Expand Up @@ -251,6 +251,7 @@ func (h *scaleHandler) checkScaledJobScalers(ctx context.Context, scalers []scal
}
scalerLogger.Info("QueueLength Metric value", "queueLength", queueLength)

scaler.Close()
if err != nil {
scalerLogger.V(1).Info("Error getting scale decision, but continue", "Error", err)
continue
Expand Down

0 comments on commit 9c47512

Please sign in to comment.