revert delete on drop

This commit is contained in:
YouROK
2021-06-01 23:05:53 +03:00
parent 1bd5a9b899
commit b06cd97110

View File

@@ -90,11 +90,11 @@ func (c *Cache) Piece(m metainfo.Piece) storage.PieceImpl {
func (c *Cache) Close() error { func (c *Cache) Close() error {
log.TLogln("Close cache for:", c.hash) log.TLogln("Close cache for:", c.hash)
delete(c.storage.caches, c.hash) delete(c.storage.caches, c.hash)
for _, v := range c.pieces { //for _, v := range c.pieces {
if v.dPiece != nil { // if v.dPiece != nil {
os.Remove(v.dPiece.name) // os.Remove(v.dPiece.name)
} // }
} //}
c.pieces = nil c.pieces = nil
c.muReaders.Lock() c.muReaders.Lock()