diff --git a/cache/service/service.go b/cache/service/service.go index 54015836e..f36a0e5c5 100644 --- a/cache/service/service.go +++ b/cache/service/service.go @@ -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 {