From 02cb6540223e16c8eb1aa2db9d74ad2affbbeef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Mon, 11 Sep 2023 03:12:24 +0000 Subject: [PATCH] hack handle key miss --- api/advent22_api/core/webdav.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/api/advent22_api/core/webdav.py b/api/advent22_api/core/webdav.py index 672a6ce..5904c74 100644 --- a/api/advent22_api/core/webdav.py +++ b/api/advent22_api/core/webdav.py @@ -71,8 +71,14 @@ class WebDAV: cls._webdav_client.resource(path).read_from(buffer) - # Cache-Eintrag entfernen (hack: siehe AsyncTTL._TTL.__contains__) - del cls._rb_ttl.ttl[KEY((path,), {})] + try: + # hack: zugehörigen Cache-Eintrag entfernen + # -> AsyncTTL._TTL.__contains__ + del cls._rb_ttl.ttl[KEY((path,), {})] + + except KeyError: + # Cache-Eintrag existierte nicht + pass @classmethod async def write_str(cls, path: str, content: str, encoding="utf-8") -> None: