mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
fix read a head
This commit is contained in:
@@ -198,11 +198,10 @@ func (t *Torrent) updateRA() {
|
|||||||
if t.Torrent != nil && t.Torrent.Info() != nil {
|
if t.Torrent != nil && t.Torrent.Info() != nil {
|
||||||
pieceLen := t.Torrent.Info().PieceLength
|
pieceLen := t.Torrent.Info().PieceLength
|
||||||
adj := pieceLen * int64(t.Torrent.Stats().ActivePeers) / int64(1+t.cache.Readers())
|
adj := pieceLen * int64(t.Torrent.Stats().ActivePeers) / int64(1+t.cache.Readers())
|
||||||
switch {
|
if adj < pieceLen {
|
||||||
case adj < pieceLen:
|
|
||||||
adj = pieceLen
|
adj = pieceLen
|
||||||
case adj > pieceLen*4:
|
//} else if adj > pieceLen*4 {
|
||||||
adj = pieceLen * 4
|
// adj = pieceLen * 4
|
||||||
}
|
}
|
||||||
go t.cache.AdjustRA(adj)
|
go t.cache.AdjustRA(adj)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user