store_discovery
Finds the SQLite stores the cache encryption sweep covers.
Each kind of store is looked for under its own known root, never by searching the cache directory as a whole, which also holds files the sweep must not touch (the trials mapping database and Prefect's database among them):
- each pod's
background_cache.db, under<cache_dir>/pods/<pod>/, and its backup snapshots; - every
*.sqlitefile under the dataset cache directory; - project databases:
*.sqlitefiles directly in a project-database directory. A plaintext one counts only if it has atask_definitionstable, so a user's own SQLite file in that directory is left alone; - each project's uploaded-MRN store,
<task_results_dir>/<project>/_uploaded_mrns.
Roots are read from the settings when called, not when imported.
Module
Functions
find_stores
def find_stores( *, pod_names: Sequence[str] | None = None, project_db_dirs: Sequence[Path] = (),) ‑> list[Store]:Lists every store the cache encryption sweep covers.
Arguments
pod_names: Only these pods' background caches;Nonefor every pod's. Dataset caches, project databases and uploaded-MRN stores are listed either way.project_db_dirs: The directories holding project databases.
Returns Each store once, whichever root reached it first, even if two roots overlap. A missing root contributes nothing.
Classes
Store
class Store(path: Path, store_type: StoreType):One store the sweep covers.
Attributes
path: The SQLite file; forUPLOADED_MRNS, the store's directory.store_type: What it is.
StoreType
class StoreType(*args, **kwds):What a store is. Short codes, safe for telemetry and logs.
Ancestors
Variables
- static
BACKGROUND_CACHE
- static
BACKGROUND_CACHE_BACKUP
- static
DATASET_CACHE
- static
PROJECT_DB
- static
UPLOADED_MRNS