(path string)
| 273 | } |
| 274 | |
| 275 | func (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 | |
| 294 | func (w *Watcher) computePerPathUpdatesLocked(oldByID, newByID map[string]*coreauth.Auth) []AuthUpdate { |
| 295 | if w.currentAuths == nil { |
no test coverage detected