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

perf: prevent caches from frappe.clear_cache #2373

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ankush
Copy link
Member

@ankush ankush commented Dec 18, 2024

This happens because sites are renamed and rename can't reliably guess what
else got modified via queries so it just drops everything.

AFAIK, new sites are renamed so they don't have anything else linking to them.
So it's fine to just... ignore it.

Risks:

  • Old site renames -> Might require manual eviction
  • Other valid use of frappe.clear_cache() can break, use frappe.cache.flushall()

I also identified bunch of keys that need to be "persistent", added them all to separate list.

⚠️ UNTESTED CODE. Use with caution and be ready to rollback 😄

Press is single-deploy, so this is fine.
It's almost equivalent to frappe.clear_cache()
# - Use frappe.cache.flushall() instead.
persistent_cache_keys = [
*__persistent_cache_keys,
"agent_job_step_output",
Copy link
Member Author

Choose a reason for hiding this comment

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

This one isn't evicted anywhere btw, it can get huge but we have tons of memory so 🤷

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.

1 participant