File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ import (
5959
6060const (
6161 perNamespaceWorkerManagerListenerKey = "perNamespaceWorkerManager"
62+
63+ // Always refresh workers after this time even if there were no membership or namespace
64+ // state changes. This is to pick up dynamic config changes (which we can't subscribe to).
65+ refreshInterval = 10 * time .Minute
6266)
6367
6468type (
@@ -216,7 +220,15 @@ func (wm *perNamespaceWorkerManager) refreshAll() {
216220}
217221
218222func (wm * perNamespaceWorkerManager ) membershipChangedListener () {
219- for range wm .membershipChangedCh {
223+ loop:
224+ for {
225+ select {
226+ case _ , ok := <- wm .membershipChangedCh :
227+ if ! ok {
228+ break loop
229+ }
230+ case <- time .After (refreshInterval ):
231+ }
220232 wm .refreshAll ()
221233 }
222234}
You can’t perform that action at this time.
0 commit comments