1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-20 19:08:46 +00:00

Merge pull request #4 from dramich/queue24

[backport] Drop things from the queue when completed
This commit is contained in:
Darren Shepherd
2020-04-16 09:00:46 -07:00
committed by GitHub

View File

@@ -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 {
@@ -227,6 +228,7 @@ func (h *clusterCache) start() {
w := h.watchers[event.gvr]
h.RUnlock()
if w == nil {
h.workqueue.Done(eventObj)
continue
}
@@ -247,6 +249,7 @@ func (h *clusterCache) start() {
logrus.Errorf("failed to handle remove event: %v", err)
}
}
h.workqueue.Done(eventObj)
}
}