MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / cache_purge

Function cache_purge

dwave/cloud/cli.py:1304–1318  ·  view source on GitHub ↗

Remove all items from the cache.

(*, config_file, profile, output)

Source from the content-addressed store, hash-verified

1302@config_file_options()
1303@standardized_output
1304def cache_purge(*, config_file, profile, output):
1305 """Remove all items from the cache."""
1306
1307 config = validate_config_v1(load_config(config_file=config_file, profile=profile))
1308 info = _get_cache_info(config)
1309
1310 for name, collection in info.items():
1311 for stats in collection:
1312 path: Path = stats['path']
1313 if path.is_file():
1314 path.unlink()
1315 else:
1316 shutil.rmtree(path)
1317
1318 output("Cache purged.")
1319
1320
1321@cli.group()

Callers

nothing calls this directly

Calls 4

validate_config_v1Function · 0.90
load_configFunction · 0.90
_get_cache_infoFunction · 0.85
outputFunction · 0.85

Tested by

no test coverage detected