Skip to content

Commit

Permalink
feat:xdsv3 support envoy odcds
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Dec 23, 2023
1 parent a822c87 commit ab41f5c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions cache/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,35 +120,6 @@ func (sc *serviceCache) Initialize(opt map[string]interface{}) error {
return nil
}

func (sc *serviceCache) initResource() {
sc.instCache = sc.BaseCache.CacheMgr.GetCacher(types.CacheInstance).(*instanceCache)
sc.singleFlight = new(singleflight.Group)
sc.ids = utils.NewSyncMap[string, *model.Service]()
sc.names = utils.NewSyncMap[string, *utils.SyncMap[string, *model.Service]]()
sc.cl5Sid2Name = utils.NewSyncMap[string, string]()
sc.cl5Names = utils.NewSyncMap[string, *model.Service]()
sc.pendingServices = utils.NewSyncMap[string, struct{}]()
sc.namespaceServiceCnt = utils.NewSyncMap[string, *model.NamespaceServiceCount]()
sc.exportNamespace = utils.NewSyncMap[string, *utils.SyncSet[string]]()
sc.exportServices = utils.NewSyncMap[string, *utils.SyncMap[string, *model.Service]]()
ctx, cancel := context.WithCancel(context.Background())
sc.cancel = cancel
sc.revisionWorker = newRevisionWorker(sc, sc.instCache.(*instanceCache), opt)
// 先启动revision计算协程
go sc.revisionWorker.revisionWorker(ctx)
subCtx, err := eventhub.SubscribeWithFunc(eventhub.CacheNamespaceEventTopic, sc.handleNamespaceChange)
if err != nil {
return err
}
sc.subCtx = subCtx
if opt == nil {
return nil
}
sc.disableBusiness, _ = opt["disableBusiness"].(bool)
sc.needMeta, _ = opt["needMeta"].(bool)
return nil
}

// LastMtime 最后一次更新时间
func (sc *serviceCache) Close() error {
if err := sc.BaseCache.Close(); err != nil {
Expand Down

0 comments on commit ab41f5c

Please sign in to comment.