MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / pruneStaleAccessProviders

Method pruneStaleAccessProviders

internal/pluginhost/adapters.go:1143–1161  ·  view source on GitHub ↗
(nextKeys map[string]struct{})

Source from the content-addressed store, hash-verified

1141}
1142
1143func (h *Host) pruneStaleAccessProviders(nextKeys map[string]struct{}) {
1144 if h == nil {
1145 return
1146 }
1147
1148 staleKeys := make([]string, 0)
1149 h.mu.Lock()
1150 for key := range h.accessProviderKeys {
1151 if _, okKey := nextKeys[key]; !okKey {
1152 staleKeys = append(staleKeys, key)
1153 }
1154 }
1155 h.accessProviderKeys = nextKeys
1156 h.mu.Unlock()
1157
1158 for _, key := range staleKeys {
1159 sdkaccess.UnregisterProvider(key)
1160 }
1161}
1162
1163func (h *Host) RegisterUsagePlugins() {
1164 if h == nil {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected