Skip to content

Only new HoF items are shown #1825

@bwbroersma

Description

@bwbroersma

Since 1f7f18b there is an effective limit of 1_000.
However only completely new entries are shown, and old domains can not longer be 'bumped' to the top of the list like before.

def get_hof_cache(cache_id, count):
cached_data = cache.get(cache_id, None)
if cached_data is None:
return "…", 0, []
return (cached_data["date"], cached_data["count"], cached_data["data"][:count])
cached_data["data"][:count] will get the first count items, and
if is_web and is_mail:
timestamp = entry.mail_timestamp
permalink = entry.mail_permalink
if entry.web_timestamp > entry.mail_timestamp:
timestamp = entry.web_timestamp
permalink = entry.web_permalink
champions.append({"permalink": permalink, "domain": entry.domain, "timestamp": timestamp})
champions = sorted(champions, key=lambda x: x["timestamp"], reverse=True)
web = sorted(web, key=lambda x: x["timestamp"], reverse=True)
mail = sorted(mail, key=lambda x: x["timestamp"], reverse=True)
sorts it by timestamp, which should be the last
for report in model.objects.only("id", "domain", "timestamp", "score").order_by("domain", "timestamp").iterator():

To support bumping, remove this if, and always update the timestamp with the latest report:

if report_score != previousscore:
previoustimestamp = report.timestamp

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions