mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
fix freeze on close
This commit is contained in:
@@ -91,7 +91,9 @@ func (c *Cache) Close() error {
|
||||
log.TLogln("Close cache for:", c.hash)
|
||||
delete(c.storage.caches, c.hash)
|
||||
for _, v := range c.pieces {
|
||||
v.Release()
|
||||
if v.dPiece != nil {
|
||||
os.Remove(v.dPiece.name)
|
||||
}
|
||||
}
|
||||
c.pieces = nil
|
||||
|
||||
|
||||
@@ -83,7 +83,5 @@ func (p *DiskPiece) Release() {
|
||||
p.piece.Size = 0
|
||||
p.piece.Complete = false
|
||||
|
||||
os.Remove(p.name)
|
||||
|
||||
p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user