Save or cache calls to bodhi.get_active_branches() #346

Open
opened 2025-04-17 08:43:19 +00:00 by abompard · 2 comments
Contributor

On staging (and probably prod but I didn't check) there's a ton on calls to /releases/?exclude_archived=True. I think it comes from toddlers. There are places here that can spare quite a few calls to bodhi.get_active_branches(), as they are done inside loops but will always return the same thing.
There's calls in clean_retired_packages, in distgit_bugzilla_sync and in koji_block_retired.

These calls could be done only once or/and cached with dogpile.

On staging (and probably prod but I didn't check) there's a ton on calls to `/releases/?exclude_archived=True`. I think it comes from toddlers. There are places here that can spare quite a few calls to `bodhi.get_active_branches()`, as they are done inside loops but will always return the same thing. There's calls in `clean_retired_packages`, in `distgit_bugzilla_sync` and in `koji_block_retired`. These calls could be done only once or/and cached with dogpile.
Contributor

Maybe we can do the caching directly in bodhi module

Maybe we can do the caching directly in [bodhi module](https://pagure.io/fedora-infra/toddlers/blob/37b0e83deb6c15a54c4e9dea607f926c237e5b27/f/toddlers/utils/bodhi.py#_91)
Author
Contributor

Yeah that would be a possible improvement. We can easily cache this value for an hour, and the caching infrastructure is already in place (dogpile).

Yeah that would be a possible improvement. We can easily cache this value for an hour, and the caching infrastructure is already in place (`dogpile`).
Sign in to join this conversation.
No labels
cpe
EasyFix
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/toddlers#346
No description provided.