mirror of
https://github.com/FAUSheppy/flask-json-dream-website
synced 2025-12-06 16:21:35 +01:00
check for cache file before opening it
This commit is contained in:
@@ -99,6 +99,9 @@ def updateEventsFromCalDav():
|
|||||||
def getEventsCache():
|
def getEventsCache():
|
||||||
'''Return the cached events'''
|
'''Return the cached events'''
|
||||||
|
|
||||||
|
if not os.path.isfile(CACHE_FILE):
|
||||||
|
return []
|
||||||
|
|
||||||
with open(CACHE_FILE, READ) as f:
|
with open(CACHE_FILE, READ) as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user