[16.0][UPD] add empty batch remove when job vaccuum#764
Closed
julienCozo wants to merge 1 commit intoOCA:16.0from
julienCozo:16.0-add-batch-vaccuum
Closed
[16.0][UPD] add empty batch remove when job vaccuum#764julienCozo wants to merge 1 commit intoOCA:16.0from julienCozo:16.0-add-batch-vaccuum
julienCozo wants to merge 1 commit intoOCA:16.0from
julienCozo:16.0-add-batch-vaccuum
Conversation
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
AnizR
suggested changes
Sep 17, 2025
Contributor
AnizR
left a comment
There was a problem hiding this comment.
Nice initiative, I think that it makes sense to remove old batches
Can you check why your tests aren't working?
| for batch in batches: | ||
| if not batch.job_ids: | ||
| batch.unlink() | ||
| self.env.cr.commit() # pylint: disable=E8102 |
|
|
||
| Called from a cron. | ||
| """ | ||
| super().autovacuum() |
Contributor
There was a problem hiding this comment.
A good practice is to return the call of the super:
Suggested change
| super().autovacuum() | |
| ret = super().autovacuum() | |
| ... | |
| return ret |
| Called from a cron. | ||
| """ | ||
| super().autovacuum() | ||
| batches = self.env["queue.job.batch"].search([]) |
Contributor
There was a problem hiding this comment.
Suggested change
| batches = self.env["queue.job.batch"].search([]) | |
| batches = self.env["queue.job.batch"].search([('job_ids','=',False)]) |
|
@julienCozo why would you remove your branch ? Could you please attend comments from @AnizR and reopen PR ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When queue jobs performing its vaccuum, delete also queue batch where job_ids is 0.