Skip to content

Commit

Permalink
Rename variable last_fresh_time
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Dec 17, 2020
1 parent 97cdde2 commit 4d7044a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ def torrents_to_check(self):
2. Old torrents (50%)
By old torrents, we refer to those checked quite farther in the past, sorted by the last_check value.
"""
four_hours_ago = time.time() - HEALTH_FRESHNESS_SECONDS
popular_torrents = list(self.tribler_session.mds.TorrentState.select(lambda g: g.last_check < four_hours_ago).
last_fresh_time = time.time() - HEALTH_FRESHNESS_SECONDS
popular_torrents = list(self.tribler_session.mds.TorrentState.select(lambda g: g.last_check < last_fresh_time).
order_by(lambda g: (desc(g.seeders), g.last_check)).limit(TORRENT_SELECTION_POOL_SIZE))

old_torrents = list(self.tribler_session.mds.TorrentState.select(lambda g: g.last_check < four_hours_ago).
old_torrents = list(self.tribler_session.mds.TorrentState.select(lambda g: g.last_check < last_fresh_time).
order_by(lambda g: (g.last_check, desc(g.seeders))).limit(TORRENT_SELECTION_POOL_SIZE))

selected_torrents = popular_torrents + old_torrents
Expand Down

0 comments on commit 4d7044a

Please sign in to comment.