From 09db09f242f218cb96f2e0750f0a31f19a43ba1f Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Wed, 18 Oct 2023 16:37:57 +0200 Subject: [PATCH] Cache meetingcal processing This also needs to be cached, because the ical parsing and interpretation of meeting recurrence rules has a nontrivial overhead. --- sipa/utils/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sipa/utils/__init__.py b/sipa/utils/__init__.py index 2ea09c22..44acfaf4 100644 --- a/sipa/utils/__init__.py +++ b/sipa/utils/__init__.py @@ -138,6 +138,7 @@ def events_from_calendar(calendar: icalendar.Calendar) -> list[Event]: ) +@cached(cache=TTLCache(maxsize=1, ttl=300)) def meetingcal(): """Returns the calendar events got form the url in the config""" if not (calendar := try_fetch_calendar(current_app.config['MEETINGS_ICAL_URL'])):