mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
fix(generator): invalidate composite cache on not_found + drop unused import
Cache entry for widget:composite:{username} was not invalidated when a
user's fetcher payload transitioned to not_found, serving stale SVGs.
This commit is contained in:
@@ -4,7 +4,6 @@ Run as its own container: CMD python -m src.worker
|
||||
"""
|
||||
import logging
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
from . import cache, config, db, fetcher_client, placeholder, processor
|
||||
from .widgets import compose_widget
|
||||
@@ -46,6 +45,7 @@ def process_one() -> bool:
|
||||
if payload.get("error") == "not_found":
|
||||
svg = placeholder.render("not_found", username, theme="dark")
|
||||
db.put_widgets(username, "not_found", {"composite": svg})
|
||||
cache.Cache().delete(f"widget:composite:{username}")
|
||||
db.complete_job(job["id"])
|
||||
log.info("not_found marker persisted for %s", username)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user