Add a caching system in case where remote calendar is unreachable #1

Merged
jdejaegh merged 7 commits from caching into master 2020-11-03 22:20:21 +01:00
Showing only changes of commit 3b653f7bdc - Show all commits

View file

@ -76,7 +76,10 @@ def background_cache() -> None:
for entry in config: for entry in config:
if 'cache' in entry and entry['cache']: if 'cache' in entry and entry['cache']:
cache(entry) try:
cache(entry)
except:
print("Could not cache", entry)
print('Cache renewed', arrow.now().format("YYYY-MM-DD HH:mm:ss")) print('Cache renewed', arrow.now().format("YYYY-MM-DD HH:mm:ss"))
@ -88,4 +91,4 @@ class CacheThread(threading.Thread):
print("Starting cache process") print("Starting cache process")
while True: while True:
background_cache() background_cache()
time.sleep(10*60) time.sleep(10 * 60)