删除缓存文件
(path string)
| 1477 | |
| 1478 | // 删除缓存文件 |
| 1479 | func (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 | // 创建当前策略包含的内存缓存 |
| 1505 | func (this *FileStorage) createMemoryStorage() error { |