Skip to content

Add maintenance commands: clear, expire, cull, evict, check - #5

Open
shubham-dce wants to merge 1 commit into
cli-04-inspect-commandsfrom
cli-05-maintenance
Open

Add maintenance commands: clear, expire, cull, evict, check#5
shubham-dce wants to merge 1 commit into
cli-04-inspect-commandsfrom
cli-05-maintenance

Conversation

@shubham-dce

Copy link
Copy Markdown
Owner

Summary

Adds five maintenance and consistency related commands: clear, expire, cull, evict, check

Commands added

  • clear - remove all the items from the cache, and prints the count of items removed
  • expire - remove already-expired items only, and prints their count
  • cull - remove items as per the set eviction policy until the volume comes under size_limit, also prints the count of removed items
  • evict TAG - remove all items corresponding to a particular tag, and prints their count
  • check [--fix] - verify DB/filesystem consistency, prints warning messages if any exists, or confirms consistency. Also runs 'VACUUM' to fix the inconsistency if the --fix flag is turned on.

Notes

  • used explicit timeout handling for the cmd_evict as it returns the count even when exception occurs.
  • No confirmation prompts added for the destructive commands (will be added in subsequent PRs)

Testing

  • Added 8 new tests, all passing with the existing ones.
  • Coverage is at 98.35%, above project's spec of 98%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants