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

Method removeClientLocked

internal/watcher/clients.go:275–292  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

273}
274
275func (w *Watcher) removeClientLocked(path string) {
276 normalized := w.normalizeAuthPath(path)
277 w.clientsMutex.Lock()
278 oldByID := make(map[string]*coreauth.Auth, len(w.fileAuthsByPath[normalized]))
279 for id, a := range w.fileAuthsByPath[normalized] {
280 oldByID[id] = a
281 }
282 delete(w.lastAuthHashes, normalized)
283 delete(w.lastAuthContents, normalized)
284 delete(w.fileAuthsByPath, normalized)
285
286 updates := w.computePerPathUpdatesLocked(oldByID, map[string]*coreauth.Auth{})
287 w.clientsMutex.Unlock()
288
289 w.persistAuthAsync(fmt.Sprintf("Remove auth %s", filepath.Base(path)), path)
290 w.dispatchAuthUpdates(updates)
291 redisqueue.NotifyUsageRefresh()
292}
293
294func (w *Watcher) computePerPathUpdatesLocked(oldByID, newByID map[string]*coreauth.Auth) []AuthUpdate {
295 if w.currentAuths == nil {

Callers 2

removeClientMethod · 0.95
handleEventMethod · 0.95

Calls 5

normalizeAuthPathMethod · 0.95
persistAuthAsyncMethod · 0.95
dispatchAuthUpdatesMethod · 0.95
NotifyUsageRefreshFunction · 0.92

Tested by

no test coverage detected