Skip to content

Commit

Permalink
Merge pull request #4 from dramich/queue24
Browse files Browse the repository at this point in the history
[backport] Drop things from the queue when completed
  • Loading branch information
ibuildthecloud authored Apr 16, 2020
2 parents 61a9051 + a7b2fc9 commit 0a5d0fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/clustercache/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func (h *clusterCache) List(gvr schema2.GroupVersionResource) []interface{} {
}

func (h *clusterCache) start() {
defer h.workqueue.ShutDown()
for {
eventObj, ok := h.workqueue.Get()
if ok {
Expand All @@ -227,6 +228,7 @@ func (h *clusterCache) start() {
w := h.watchers[event.gvr]
h.RUnlock()
if w == nil {
h.workqueue.Done(eventObj)
continue
}

Expand All @@ -247,6 +249,7 @@ func (h *clusterCache) start() {
logrus.Errorf("failed to handle remove event: %v", err)
}
}
h.workqueue.Done(eventObj)
}
}

Expand Down

0 comments on commit 0a5d0fb

Please sign in to comment.