Enable caching

This commit is contained in:
T'rahk Rokym 2025-04-21 12:35:55 +02:00
parent ec34d7fd29
commit f88249c8fc

View File

@ -162,14 +162,11 @@ def _current_notifications() -> dict:
for hook in hooks: for hook in hooks:
logger.info(hook) logger.info(hook)
try: try:
app_notifications.extend(hook.get_announcement_list())
"""
app_notifications.extend(cache.get_or_set( app_notifications.extend(cache.get_or_set(
f"{hook.app_name}_notification_issues", f"{hook.app_name}_notification_issues",
hook.get_announcement_list, hook.get_announcement_list,
NOTIFICATION_CACHE_TIME, NOTIFICATION_CACHE_TIME,
)) ))
"""
except requests.HTTPError: except requests.HTTPError:
logger.warning("Error when getting %s notifications", hook, exc_info=True) logger.warning("Error when getting %s notifications", hook, exc_info=True)