CachedWaterQualityClient

marola.water.CachedWaterQualityClient
See theCachedWaterQualityClient companion object
final class CachedWaterQualityClient(inner: WaterQualityClient, cacheFile: Path) extends WaterQualityClient

Serves the last successful fetch when the agency cannot be reached.

The agencies go down. IMA/SC spent 2026-09-08 serving a self-signed certificate on its production host, and every floripa beach on marola.dev read "no data" for hours. Nothing about the data had changed — only our ability to re-download it.

Serving the cache is not serving stale data: WaterQuality.fresh already ages samples out at 45 days on the agency's own sample dates, which do not move because our fetch failed. A bulletin downloaded yesterday is exactly as valid today as one downloaded a minute ago. When the cached samples genuinely age out, the existing rule turns them into "no data" without help from here.

Writes only on a non-empty fetch: an agency that answers with nothing must not erase a good cache.

Attributes

Companion
object
Graph
Supertypes
trait WaterQualityClient
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def name: String
def samplingPoints: List[SamplingPoint] < Sync