Skip to content
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

Admin Statistics not updating due to cache #5393

Closed
coslajohn opened this issue Feb 15, 2024 · 1 comment · Fixed by #5456
Closed

Admin Statistics not updating due to cache #5393

coslajohn opened this issue Feb 15, 2024 · 1 comment · Fixed by #5456
Assignees
Labels

Comments

@coslajohn
Copy link
Contributor

Why this is needed

The admin/statistics page for participatory budgeting is really useful for allowing admins to be able to see how much engagement they are getting during a process.

The way it is behaving at the moment just causes confusion!

Description

Admin Statistics for Participatory Budgeting appeared to show random values on page

/admin/stats/budget_balloting?budget_id=

Some of the values on this page never update. Votes per heading appears to be ok, but the other values don't seem to update

After lots of investigation it appears to be a caching issue.

app/models/budget/stats.rb is caching the stats methods but they do not appear to be ever updated in the cache

Running Rails.cache.clear fixes the issue

For example at
https://wdn.communitychoices.scot/admin/stats/budget_balloting?budget_id=7

** Before clearing cache
image

and
https://dundeesvoice.communitychoices.scot/admin/stats/budget_balloting?budget_id=12
image

after Rails.cache.clear

image

image

@javierm
Copy link
Member

javierm commented Feb 29, 2024

It looks like this bug was introduced in commit e51e034 from pull request #4985.

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 a pull request may close this issue.

3 participants