Ergänzung Datenschutzerklärung und Impressum, Fristenformular in Einstellungen
This commit is contained in:
@@ -163,9 +163,11 @@ def lookup(db: Session, barcode: str) -> ProductCache | None:
|
||||
|
||||
cached = db.get(ProductCache, barcode)
|
||||
if cached is not None:
|
||||
from app.runtime_settings import get_duration
|
||||
|
||||
age = utcnow() - cached.fetched_at
|
||||
max_age = timedelta(
|
||||
days=settings.product_cache_days if cached.found
|
||||
days=get_duration(db, "product_cache_days") if cached.found
|
||||
else settings.product_miss_days
|
||||
)
|
||||
if age < max_age:
|
||||
|
||||
Reference in New Issue
Block a user