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
Execution plan cleaner #244
Conversation
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.
Looks good code-wise, except one potential issue. Pending tests.
|
||
def clean! | ||
plans = @world.persistence.find_old_execution_plans(Time.now.utc - @max_age) | ||
@world.persistence.delete_execution_plans(uuid: plans.map(&:id)) |
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.
Doesn't this have the issue with the blank filer on uuid => []
matching all the plans? I guess we should probably just fix this case directly in sequel persistence adapter, to avoid this issues in once and for all, as I don't see where it would actually be useful.
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.
Just tried it, looks it is safe to use now
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.
Ah, sry, my bad, I was trying it against find_execution_paln with wrong filter
18870a6
to
4b70073
Compare
Added some tests, let's see how Mr. T likes them |
The tests are green |
Tests speak for themselves: thanks @adamruzicka. Merging now |
It is disabled by default, needs to be enabled in a world's config. For the usage on smart-proxy this should be good to go since there's mostly one or two kinds of tasks (rex and ansible), so we probably don't need fine grained controls for setting different interval for different actions.