Skip to main content

write_catalog_cache

Function write_catalog_cache 

Source
pub fn write_catalog_cache(
    dir: &Path,
    meta: &CatalogCacheMeta,
    payload: &Value,
) -> Result<(), CloudflareError>
Expand description

Write the versioned catalog cache for an account-scoped directory.

Creates dir if needed and writes both files atomically (a sibling .tmp file renamed into place, mode 0o600). The payload is written first; the meta file is the commit point, so a concurrent or crashed reader never sees metadata without a fully written payload.