Skip to content

Add export command: back up cache data to a portable file using pickle - #7

Open
shubham-dce wants to merge 1 commit into
cli-06-confirmationfrom
cli-07-export
Open

Add export command: back up cache data to a portable file using pickle#7
shubham-dce wants to merge 1 commit into
cli-06-confirmationfrom
cli-07-export

Conversation

@shubham-dce

Copy link
Copy Markdown
Owner

Summary

Adds support for exporting the cache contents to a portable file using pickle

Command added

  • export FILE - takes a valid file path and export the cache content (key, value, expire, tag) to the file in bytes (pickle)

Notes

  • Used format as pickle, since cached values are not guaranteed to be JSON safe types.
  • Expiry conversion occurs at the export time. Cache's stored expire_time is an absolute timestamp, and set expects a relative time.
  • Always overwrites the filepath given to the command, as provided by the user deliberately. (Further scope exists for confirmation)

Testing

  • Added 2 tests, passing successfully. Test coverage is at 98.31%

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