feat 默认模块
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user