many changes
This commit is contained in:
+16
-4
@@ -138,7 +138,10 @@ def _series_declared_groups_cache_key(series_id):
|
||||
def invalidate_series_declared_groups_cache(series_id):
|
||||
if not series_id:
|
||||
return
|
||||
cache.delete(_series_declared_groups_cache_key(series_id))
|
||||
try:
|
||||
cache.delete(_series_declared_groups_cache_key(series_id))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _build_declared_series_groups(series, series_images_with_urls):
|
||||
@@ -155,7 +158,10 @@ def _build_declared_series_groups(series, series_images_with_urls):
|
||||
for image_obj, image_url in series_images_with_urls
|
||||
],
|
||||
}
|
||||
cached = cache.get(cache_key)
|
||||
try:
|
||||
cached = cache.get(cache_key)
|
||||
except Exception:
|
||||
cached = None
|
||||
if isinstance(cached, dict):
|
||||
if cached.get("signature") == signature:
|
||||
return cached.get("groups", [])
|
||||
@@ -257,7 +263,10 @@ def _build_declared_series_groups(series, series_images_with_urls):
|
||||
"groupValues": {},
|
||||
}
|
||||
]
|
||||
cache.set(cache_key, {"signature": signature, "groups": result}, timeout=60 * 60)
|
||||
try:
|
||||
cache.set(cache_key, {"signature": signature, "groups": result}, timeout=60 * 60)
|
||||
except Exception:
|
||||
pass
|
||||
return result
|
||||
|
||||
grouped = {}
|
||||
@@ -313,7 +322,10 @@ def _build_declared_series_groups(series, series_images_with_urls):
|
||||
}
|
||||
)
|
||||
|
||||
cache.set(cache_key, {"signature": signature, "groups": ordered_groups}, timeout=60 * 60)
|
||||
try:
|
||||
cache.set(cache_key, {"signature": signature, "groups": ordered_groups}, timeout=60 * 60)
|
||||
except Exception:
|
||||
pass
|
||||
return ordered_groups
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user