From 5209bf06ca7003381eadbb0d5b63c3657ff6ee8e Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Fri, 9 Feb 2024 17:26:08 +0100 Subject: [PATCH] fix: delete cachefiles if they are empty --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index d26e70c..4facd83 100755 --- a/main.py +++ b/main.py @@ -52,6 +52,10 @@ def downloadFlugfeldData(fromTime, toTime, dtype): cacheFile = CACHE_FILE_TEMPLATE.format(dtype, fromTimeStr, toTimeStr) fullpath = os.path.join(cacheDir, cacheFile) + # remove empty placeholder cache file # + if os.path.getsize(fullpath) == 0: + os.remove(fullpath) + # check for cache file content = None if not os.path.isfile(fullpath):