mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 00:42:30 +00:00
Merge pull request #2049 from PR0M3TH3AN/codex/update-timeoutid-handler-in-probepeers
Use webseed-aware peer counts for probePeers timeout
This commit is contained in:
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