Update query_resource.py

This commit is contained in:
HibiKier 2021-08-04 18:47:10 +08:00 committed by GitHub
parent 12212ecf65
commit 96d1bd3575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,7 @@ async def download_map_init(
global CENTER_POINT, MAP_RATIO
map_path.mkdir(exist_ok=True, parents=True)
_map = map_path / "map.png"
if os.path.getsize(_map) > 1024 * 1024 * 30:
if _map.exists() and os.path.getsize(_map) > 1024 * 1024 * 30:
_map.unlink()
async with session.get(MAP_URL, timeout=5) as response:
if response.status == 200: