From 6e624401028e2f7c444846a4e9326c7c093d123c Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 27 Nov 2026 10:46:12 +0100 Subject: [PATCH] Drop the tile store; a map counts only when every tile came Review round 3 found two more holes in the disk tile store: a lone fetched placeholder tile could not be judged and was kept, then vouched for its neighbours; and a map with some tiles on disk and the rest refused counted as whole, so a poster with black squares was kept for good. Three rounds on one part: the store is taken out of this change, to come back designed whole (placeholders remembered, a lone tile judged against a fresh neighbour). Tiles are fetched in parallel as before, all from the network. A map is drawn only when every tile it needs came and they are not all one picture; otherwise it is None, and its poster or thumb is drawn without it, served for five minutes and not kept. A race poster is kept only when its world locator came too. Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh --- README.md | 11 +++---- posters_service.py | 73 ++++++++++++++-------------------------------- 2 files changed, 28 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index e1bb715..f3e1cf3 100644 --- a/README.md +++ b/README.md @@ -131,11 +131,12 @@ rate limit and kept in `cache/jolpica/`; a throttled or failed fetch is said in ## Caching -Everything the service fetches or renders is kept in `cache/` (the module's cache volume): race schedules from -Jolpica in `cache/jolpica/` (a season that is over for good, the running one for six hours), map tiles in -`cache/tiles/` (30 days), and every poster and thumbnail in `cache/posters/` once its map or photo came. A poster is -sent with an `ETag` and a day's `Cache-Control`; one whose map or photo failed is not kept, and is sent with five -minutes', so it is rendered again once its source answers. +What the service fetches or renders is kept in `cache/` (the module's cache volume): race schedules from Jolpica +in `cache/jolpica/` (a season that is over for good, the running one for six hours), and every poster and thumbnail +in `cache/posters/` once every map tile and photo it needs came. A poster is sent with an `ETag` and a day's +`Cache-Control`; one whose map or photo failed is not kept, and is sent with five minutes', so it is rendered again +once its source answers. Map tiles are fetched in parallel, at most six at once from Esri and two from +OpenStreetMap. ## Checks diff --git a/posters_service.py b/posters_service.py index 950579a..914ae40 100644 --- a/posters_service.py +++ b/posters_service.py @@ -19,7 +19,6 @@ import logging import math import os import threading -import time import urllib.parse import urllib.request from concurrent.futures import ThreadPoolExecutor @@ -78,9 +77,6 @@ TILE_PROVIDERS = { }, } -# Tiles are kept on disk under cache/tiles/