mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-06 06:51:35 +01:00
fix: delete cachefiles if they are empty
This commit is contained in:
4
main.py
4
main.py
@@ -52,6 +52,10 @@ def downloadFlugfeldData(fromTime, toTime, dtype):
|
|||||||
cacheFile = CACHE_FILE_TEMPLATE.format(dtype, fromTimeStr, toTimeStr)
|
cacheFile = CACHE_FILE_TEMPLATE.format(dtype, fromTimeStr, toTimeStr)
|
||||||
fullpath = os.path.join(cacheDir, cacheFile)
|
fullpath = os.path.join(cacheDir, cacheFile)
|
||||||
|
|
||||||
|
# remove empty placeholder cache file #
|
||||||
|
if os.path.getsize(fullpath) == 0:
|
||||||
|
os.remove(fullpath)
|
||||||
|
|
||||||
# check for cache file
|
# check for cache file
|
||||||
content = None
|
content = None
|
||||||
if not os.path.isfile(fullpath):
|
if not os.path.isfile(fullpath):
|
||||||
|
|||||||
Reference in New Issue
Block a user