-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Added a Clean old history command to clean older history entries by cron/task #675
Added a Clean old history command to clean older history entries by cron/task #675
Conversation
Codecov Report
@@ Coverage Diff @@
## master #675 +/- ##
==========================================
+ Coverage 97.11% 97.23% +0.11%
==========================================
Files 17 18 +1
Lines 936 976 +40
Branches 140 147 +7
==========================================
+ Hits 909 949 +40
Misses 13 13
Partials 14 14
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PauloPeres thanks for submitting this feature. Just looked through with first round of comments
from ...exceptions import NotHistoricalModelError | ||
|
||
|
||
class Command(populate_history.Command): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't love inheriting from another command here. Would prefer you refactor the shared functions into a shared commands utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kinda Following the same pattern made to clean_duplicate_history.py
, it also inherit from populate_history.Command
fixing misspeling Co-authored-by: Ross Mechanic <[email protected]>
Accepting @rossmechanic changes Co-authored-by: Ross Mechanic <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thx Guys! |
Description
I'm only doing 30 days of History as default, but it's a parameters that can be changed.
Creating this command/task to be able to have it on a cron to clean old Historical Entries
Related Issue
Fixing #198 Properly
Also #313
Motivation and Context
Had to create a script to clean the old history because it was causing a too large database on my project, this prevents databases to grow larger than necessary
How Has This Been Tested?
Tested with the databases of my projects and worked, also wrote the coverage tests based on the
clean_duplicate_history
test bedTypes of changes
Checklist:
make format
command to format my codeAUTHORS.rst
CHANGES.rst