mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Use peer counts in probePeers timeout
This commit is contained in:
1 parent
2f5a325695
commit
cf3631c4c8
1 file changed
+3
-2
+3
-2
@@ -415,8 +415,9 @@ export class TorrentClient {
|
||||
|
||||
if (safeTimeout > 0) {
|
||||
timeoutId = setTimeout(() => {
|
||||
const peers = Math.max(0, Math.floor(normalizeNumber(torrent?.numPeers, 0)));
|
||||
const webseedOnly = peers === 0 && hasWebSeed;
|
||||
const counts = getPeerCounts();
|
||||
const peers = Math.max(0, counts.totalPeers);
|
||||
const webseedOnly = counts.regularPeers === 0 && counts.webSeeds > 0;
|
||||
if (typeof process !== "undefined" && process.env.NODE_ENV === "test" && !webseedOnly && hasWebSeed) {
|
||||
console.log(`[probePeers:timeout] logic check: peers=${peers} hasWebSeed=${hasWebSeed} webseedOnly=${webseedOnly}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user