fix: sonarcloud (#4453)

This commit is contained in:
Charles Kerr
2022-12-23 10:56:27 -06:00
committed by GitHub
parent a1892f2c7c
commit 14a3d01e45
6 changed files with 25 additions and 38 deletions

View File

@@ -45,10 +45,7 @@ using namespace std::literals;
/* unless the tracker says otherwise, rescrape this frequently */
static auto constexpr DefaultScrapeIntervalSec = int{ 60 * 30 };
/* unless the tracker says otherwise, this is the announce interval */
static auto constexpr DefaultAnnounceIntervalSec = int{ 60 * 10 };
/* unless the tracker says otherwise, this is the announce min_interval */
static auto constexpr DefaultAnnounceMinIntervalSec = int{ 60 * 2 };
/* the value of the 'numwant' argument passed in tracker requests. */
static auto constexpr Numwant = int{ 80 };
@@ -528,6 +525,12 @@ struct tr_tier
bool isScraping = false;
private:
// unless the tracker says otherwise, this is the announce interval
static auto constexpr DefaultAnnounceIntervalSec = int{ 60 * 10 };
// unless the tracker says otherwise, this is the announce min_interval
static auto constexpr DefaultAnnounceMinIntervalSec = int{ 60 * 2 };
[[nodiscard]] static time_t getNextScrapeTime(tr_session const* session, tr_tier const* tier, int interval)
{
// Maybe don't scrape paused torrents