(stop <-chan struct{})
| 286 | } |
| 287 | |
| 288 | func (w *WorkerPool) tryScaleInWorkerQueue(stop <-chan struct{}) { |
| 289 | t := time.NewTicker(w.scaleInQueueDuration) |
| 290 | for { |
| 291 | select { |
| 292 | case <-t.C: |
| 293 | w.scaleInWorkerQueue() |
| 294 | case <-stop: |
| 295 | return |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | func (w *WorkerPool) scaleInWorkerQueue() { |
| 301 | workers, err := w.podLister.List(labels.Set{constants.WorkerOwnerLabelKey: ""}.AsSelector()) |