fix: delete cachefiles if they are empty

This commit is contained in:
2024-02-09 17:26:08 +01:00
parent 1dc3a4671a
commit 5209bf06ca

View File

@@ -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):