Skip to content

Celery: increase frequency of delete_closed_external_versions task #10425

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

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

humitos
Copy link
Member

@humitos humitos commented Jun 13, 2023

We have 255k versions that should have been deleted already, but we are executing the task with a limit of 200 version. This makes the task to not catch up with all the versions that has to delete, and we keep accumulating them.

This commit increases the frequency from "once a day" to "every 3 hours". It will help to catch up and to keep our database clean of closed PRs.

Related https://github.com/readthedocs/readthedocs-ops/issues/1291

We have 255k versions that should have been deleted already, but we are
executing the task with a limit of 200 version. This makes the task to not catch
up with all the versions that has to delete, and we keep accumulating them.

This commit increases the frequency from "once a day" to "every 3 hours". It
will help to catch up and to keep our database clean of closed PRs.

Related readthedocs/readthedocs-ops#1291
@humitos humitos requested a review from stsewd June 13, 2023 11:05
@humitos humitos requested a review from a team as a code owner June 13, 2023 11:05
@humitos humitos merged commit 9565578 into main Jun 14, 2023
@humitos humitos deleted the humitos/task-closed-external-version branch June 14, 2023 09:04
@humitos
Copy link
Member Author

humitos commented Jun 21, 2023

I checked this today: we have 258k versions

from readthedocs.builds.constants import (
    EXTERNAL_VERSION_STATE_CLOSED,
)

days_ago = timezone.now() - timezone.timedelta(days=days)
queryset = Version.external.filter(
    state=EXTERNAL_VERSION_STATE_CLOSED,
    modified__lte=days_ago,
)

queryset.count()

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.

2 participants