Skip to content

[19.0] [IMP] queue_job: clean old jobs from the base autovacuum - #1014

Open
ivantodorovich wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-imp-queue_job-autovacuum
Open

ivantodorovich wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-imp-queue_job-autovacuum

Conversation

@ivantodorovich

Copy link
Copy Markdown
Contributor

Neutralized databases disable every cron except the base autovacuum, so old jobs were never removed there.
Replace the dedicated cron with an @api.autovacuum method, which is the "odoo-way" of cleaning these things anyways

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbidoul, @guewen,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:queue_job Module queue_job mod:test_queue_job Module test_queue_job labels Oct 20, 2026
@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-queue_job-autovacuum branch 2 times, most recently from f6c2fe9 to b843e73 Compare October 20, 2026 17:19
Comment thread queue_job/__manifest__.py
{
"name": "Job Queue",
"version": "19.0.2.1.6",
"version": "19.0.2.2.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

manual bump for the migration script

@ivantodorovich
ivantodorovich marked this pull request as ready for review October 20, 2026 17:20

@divad1196 divad1196 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ivantodorovich
The PR works, but the vacuum could still be done with the ORM.

I proposed a different version that also handle a forgotten edge-case

Comment thread queue_job/models/queue_job.py Outdated

@amh-mw amh-mw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code review only, LGTM. Odoo 14 introduced api.autovacuum!

Neutralized databases disable every cron except the base autovacuum,
so old jobs were never removed there. Replace the dedicated cron with
an @api.autovacuum method, deleting in batches of 1000.
@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-queue_job-autovacuum branch from b843e73 to 8ec9ef2 Compare October 22, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants