1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-28 03:57:02 +02:00

fix:polaris config watch (#3082)

* 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 <tanzhuo@dingdandao.com>
This commit is contained in:
tan-zhuo 2023-12-04 11:32:19 +08:00 committed by GitHub
parent cd9ef38d13
commit 6be961078c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
package polaris
import (
"context"
"path/filepath"
"strings"
@ -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 {