feat 默认模块

This commit is contained in:
2026-01-20 12:07:18 +08:00
parent a47557920c
commit 1edebb439c
10 changed files with 98 additions and 33 deletions

View File

@@ -41,7 +41,7 @@ func onCBByType(t common.ListenerType, data any) {
}
}
func Listen() {
func Listen(ready *sync.WaitGroup) {
var stopCtx context.Context
stopCtx, stopFunc = context.WithCancel(context.Background())
wg.Add(1)
@@ -60,6 +60,8 @@ func Listen() {
onInstanceChange(clientv3.EventTypePut, string(kv.Key), string(kv.Value), nil)
}
chInstance := etcd.GetClient().Watch(common.KeyDiscoverScene, clientv3.WithPrefix(), clientv3.WithRev(instanceAll.Header.Revision+1), clientv3.WithPrevKV())
// 准备好了
ready.Done()
for {
select {
case msg := <-chService: