more docs
Some checks failed
Run testing on the backend code / Build (pull_request) Has been cancelled
Run linting on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m39s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 24s

This commit is contained in:
2025-01-28 16:24:51 +01:00
parent 1240f86d6e
commit 699737bc40
3 changed files with 26 additions and 22 deletions

View File

@@ -321,24 +321,3 @@ def get_base_info(elem: dict, osm_type: OSM_TYPES, with_name=False) :
return osm_id, coords, name
else :
return osm_id, coords
def fill_cache():
overpass = Overpass()
with os.scandir(OSM_CACHE_DIR) as it:
for entry in it:
if entry.is_file() and entry.name.startswith('hollow_'):
# Read the whole file content as a string
with open(entry.path, 'r') as f:
try :
# load data and fill the cache with the query and key
json_data = json.load(f)
overpass.fill_cache(json_data)
except Exception as exc :
overpass.logger.error(f'An error occured while parsing file {f} as .json file')
# Now delete the file as the cache is filled
os.remove(entry.path)