1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-29 11:06:23 +00:00

perf: check torrrent seed ratio less frequently (#3747)

This commit is contained in:
Charles Kerr 2022-09-01 21:16:43 -05:00 committed by GitHub
parent b01eebdaf4
commit 6d721fe32f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2273,15 +2273,19 @@ void tr_peerMgr::rechokePulse() const
for (auto* const tor : session->torrents()) for (auto* const tor : session->torrents())
{ {
if (!tor->isRunning) if (tor->isRunning)
{ {
continue; // possibly stop torrents that have seeded enough
tr_torrentCheckSeedLimit(tor);
} }
if (auto* const swarm = tor->swarm; swarm->stats.peer_count > 0) if (tor->isRunning)
{ {
rechokeUploads(swarm, now); if (auto* const swarm = tor->swarm; swarm->stats.peer_count > 0)
rechokeDownloads(swarm); {
rechokeUploads(swarm, now);
rechokeDownloads(swarm);
}
} }
} }
} }
@ -2564,9 +2568,6 @@ void tr_peerMgr::bandwidthPulse()
/* torrent upkeep */ /* torrent upkeep */
for (auto* const tor : session->torrents()) for (auto* const tor : session->torrents())
{ {
/* possibly stop torrents that have seeded enough */
tr_torrentCheckSeedLimit(tor);
/* run the completeness check for any torrents that need it */ /* run the completeness check for any torrents that need it */
if (tor->swarm->needs_completeness_check) if (tor->swarm->needs_completeness_check)
{ {