Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dump and load bytes and add back up limit #207

Merged
merged 6 commits into from
May 11, 2023

Conversation

fatanugraha
Copy link
Contributor

@fatanugraha fatanugraha commented May 3, 2023

  1. Added support to back up and restore bytes data.
  2. Added new flags to stop the backup process after reached certain limit.

if isinstance(obj, bytes):
return base64.b64encode(obj).decode("utf-8")

return json.JSONEncoder.encoder(self, ob)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return json.JSONEncoder.encoder(self, ob)
return json.JSONEncoder.encoder(self, obj)

I think there is a typo here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out, not sure why this passed my manual testing in the past 🤔

@@ -1241,6 +1263,9 @@ def main():
parser.add_argument(
"--log", help="Logging level - DEBUG|INFO|WARNING|ERROR|CRITICAL [optional]"
)
parser.add_argument(
"--limit", help="Limit option for backup, will stop the back up process after number of backed up items exceeded the limit [optional]", type=int
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please replace exceeded with reaches instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Owner

@bchew bchew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fatanugraha thanks for the PR! Could you please resolve the linting issue picked up by CI 🙂

@sonarcloud
Copy link

sonarcloud bot commented May 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@fatanugraha
Copy link
Contributor Author

Ah apologies, I missed out flake8 lint issues. Pushed the change 🙇

Copy link
Owner

@bchew bchew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fatanugraha

@bchew bchew merged commit d1d4804 into bchew:master May 11, 2023
@bchew bchew mentioned this pull request May 11, 2023
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.

3 participants