Skip to content

Commit

Permalink
fix:polaris config watch (#3082)
Browse files Browse the repository at this point in the history
* fix:the high CPU usage issue caused by watching the Polaris config, particularly in situations when config events are closed.

* fix:the high CPU usage issue caused by watching the Polaris config, particularly in situations when config events are closed.

---------

Co-authored-by: tanzhuo <[email protected]>
  • Loading branch information
tan-zhuo and tanzhuo authored Dec 4, 2023
1 parent cd9ef38 commit 6be9610
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/polaris/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package polaris

import (
"context"
"path/filepath"
"strings"

Expand Down Expand Up @@ -110,7 +111,7 @@ func (w *ConfigWatcher) Next() ([]*config.KeyValue, error) {
}
return w.cfg, nil
}
return w.cfg, nil
return nil, context.Canceled
}

func (w *ConfigWatcher) Stop() error {
Expand Down

0 comments on commit 6be9610

Please sign in to comment.