From 02df404e040c25991948098fab3341dc8e91c5d7 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Thu, 19 Aug 2021 08:53:08 +0300 Subject: [PATCH] don' differentiate priorities here to avoid cache end pieces overlap early normal ones --- server/torr/storage/torrstor/cache.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/torr/storage/torrstor/cache.go b/server/torr/storage/torrstor/cache.go index 187822f..7865d40 100644 --- a/server/torr/storage/torrstor/cache.go +++ b/server/torr/storage/torrstor/cache.go @@ -253,16 +253,16 @@ func (c *Cache) getRemPieces() []*Piece { if limit > 40 { limit = 40 } - count := limit +// count := limit for pc <= end && limit > 0 { if !c.pieces[pc].Complete { if c.torrent.PieceState(pc).Priority == torrent.PiecePriorityNone { - if limit < count/2 { - c.torrent.Piece(pc).SetPriority(torrent.PiecePriorityHigh) - } else { - c.torrent.Piece(pc).SetPriority(torrent.PiecePriorityNormal) - } +// if limit < count/2 { +// c.torrent.Piece(pc).SetPriority(torrent.PiecePriorityHigh) +// } else { + c.torrent.Piece(pc).SetPriority(torrent.PiecePriorityNormal) +// } } limit-- }