MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / removeCacheFile

Method removeCacheFile

internal/caches/storage_file.go:1479–1502  ·  view source on GitHub ↗

删除缓存文件

(path string)

Source from the content-addressed store, hash-verified

1477
1478// 删除缓存文件
1479func (this *FileStorage) removeCacheFile(path string) error {
1480 var openFileCache = this.openFileCache
1481 if openFileCache != nil {
1482 openFileCache.Close(path)
1483 }
1484
1485 var err = fsutils.Remove(path)
1486 if err == nil || os.IsNotExist(err) {
1487 err = nil
1488
1489 // 删除Partial相关
1490 var partialPath = PartialRangesFilePath(path)
1491 if openFileCache != nil {
1492 openFileCache.Close(partialPath)
1493 }
1494
1495 _, statErr := os.Stat(partialPath)
1496 if statErr == nil {
1497 _ = fsutils.Remove(partialPath)
1498 SharedPartialRangesQueue.Delete(partialPath)
1499 }
1500 }
1501 return err
1502}
1503
1504// 创建当前策略包含的内存缓存
1505func (this *FileStorage) createMemoryStorage() error {

Callers 6

openReaderMethod · 0.95
openWriterMethod · 0.95
DeleteMethod · 0.95
PurgeMethod · 0.95
purgeLoopMethod · 0.95

Calls 5

PartialRangesFilePathFunction · 0.85
CloseMethod · 0.65
RemoveMethod · 0.65
StatMethod · 0.65
DeleteMethod · 0.65

Tested by 1