MCPcopy
hub / github.com/daptin/daptin / Remove

Method Remove

server/cache/file_cache.go:318–336  ·  view source on GitHub ↗

Remove removes an entry from cache

(key string)

Source from the content-addressed store, hash-verified

316
317// Remove removes an entry from cache
318func (fc *FileCache) Remove(key string) {
319 // First check if cache is closed
320 fc.closeMutex.RLock()
321 if fc.closed {
322 fc.closeMutex.RUnlock()
323 return
324 }
325 fc.closeMutex.RUnlock()
326
327 // Write lock for cache access
328 fc.cacheMutex.Lock()
329 defer fc.cacheMutex.Unlock()
330
331 // Remove from Olric cache
332 _, err := fc.cache.Delete(context.Background(), key)
333 if err != nil && err != olric.ErrKeyNotFound {
334 log.Printf("Error removing key %s from Olric cache: %v", key, err)
335 }
336}
337
338// RemoveAsync removes an entry from cache asynchronously using worker pool
339func (fc *FileCache) RemoveAsync(key string) {

Callers 9

RemoveAsyncMethod · 0.95
createServerFunction · 0.80
CleanUpConfigFilesFunction · 0.80
OpenFileMethod · 0.80
DeleteFileMethod · 0.80
DoActionMethod · 0.80
DoActionMethod · 0.80
DeleteFileByNameMethod · 0.80

Calls 1

DeleteMethod · 0.45

Tested by 1

createServerFunction · 0.64