-
Notifications
You must be signed in to change notification settings - Fork 150
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
celery: add update_domain_status task #2903
Conversation
invenio_app_rdm/config.py
Outdated
@@ -429,6 +429,10 @@ def files_rest_permission_factory(obj, action): | |||
"task": "invenio_accounts.tasks.delete_ips", | |||
"schedule": timedelta(hours=6), | |||
}, | |||
"update_domain_status": { | |||
"task": "invenio_accounts.tasks.update_domain_status", | |||
"schedule": timedelta(minutes=60), |
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.
"schedule": timedelta(minutes=60), | |
"schedule": timedelta(hours=4), |
minor: a bit arbitrary, but since the underlying query is also performing updates to the database, I think seeing updates 2-3 times during working hours is good enough.
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.
Note, the task doesn't update the index, just the db. Probably the task https://github.com/inveniosoftware/invenio-accounts/blob/24f9ac29879f2daa7e49c94c0370444fc4dc89aa/invenio_accounts/tasks.py#L81 should be updated to also index the domains that it changes.
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.
FYI chose hourly as this comment says it ideally should be run regularly so that the changeset doesn't get too big https://github.com/inveniosoftware/invenio-accounts/blob/master/invenio_accounts/tasks.py#L123
Would probably be good to change it so that it doesn't require small changesets but I would like for some of my PRs to not result in fixing a larger issue 😅
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.
Once we've updated the task to also reindex (using the bulk queue), I would say we merge and see if it needs adjustments in terms of the regularity, bulk size, or similar.
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.
updating indexed shelved here inveniosoftware/invenio-accounts#502
b8678c2
to
cc2cb7f
Compare
cc2cb7f
to
e65885b
Compare
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.
LGTU! Peer reviewed witj @jrcastro2
❤️ Thank you for your contribution!
(Part of) Close #2777
Description
Run update domain statistics task every hour. These statistics change when users create accounts, get blocked, etc
We simply never added a task to update these regularly
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: