Skip to content

Jonathan/cache cache size

Description

//: # Calculating the size of the artifact cache currently always happens at startup, and can take a long time. This Merge Request writes the artifact size to disk, and reads it on startup.

Changes proposed in this merge request:

  • The cache quota is now stored in the artifact cache, and the checking for whether it's a valid quota size happens in there, now. The Context just reads the cache size specified in config.
  • The cache size is read from disk in ArtifactCache.get_approximate_cache_size, if the estimated size has not been set.
  • The cache size is written to disk whenever _set_cache_size or _add_artifact_size are called.
    • Except for when cache_size in _set_cache_size is None, to avoid the cleanup task getting stuck in a loop.
  • Tests have been changed to fix errors that arose from calculating the cache quota in the ArtifactCache.

This merge request, when approved, will satisfy part of #466 (closed), however there are more changes that need to be made before it's resolved.

Merge request reports

Loading