From 9db9bda0c5a9192b21db25243091c5767b0b0285 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Tue, 31 Oct 2023 09:05:49 +0300 Subject: [PATCH] fix lock --- server/torr/storage/torrstor/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/torr/storage/torrstor/cache.go b/server/torr/storage/torrstor/cache.go index e128ef2..5a16480 100644 --- a/server/torr/storage/torrstor/cache.go +++ b/server/torr/storage/torrstor/cache.go @@ -263,7 +263,7 @@ func (c *Cache) setLoadPriority(ranges []Range) { readerPos := r.getReaderPiece() readerRAHPos := r.getReaderRAHPiece() end := r.getPiecesRange().End - count := settings.BTsets.ConnectionsLimit / c.Readers() // max concurrent loading blocks + count := settings.BTsets.ConnectionsLimit / len(c.readers) // max concurrent loading blocks limit := 0 for i := readerPos; i < end && limit < count; i++ { if !c.pieces[i].Complete {