Skip to content

Commit

Permalink
When loading unprocessed records, process those with the most downloa…
Browse files Browse the repository at this point in the history
…ds first.
  • Loading branch information
jaraco committed Jan 13, 2025
1 parent 63954d8 commit 81b1b5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ def from_row(cls, row):

@classmethod
def unprocessed(cls):
query = {"updated": {"$exists": False}}
return map(cls, map(operator.itemgetter('id'), store().find(query)))
query = dict(updated={"$exists": False})
sort = dict(downloads=-1)
return map(cls, map(operator.itemgetter('id'), store().find(query, sort=sort)))

def refresh(self):
vars(self).update(self.from_wheel())
Expand Down

0 comments on commit 81b1b5a

Please sign in to comment.