moo.core.utils.flush_attribute_caches
- moo.core.utils.flush_attribute_caches()
Evict the cross-process verb- and property-lookup caches from Redis.
The
moo:verb:*andmoo:prop:*keys cache inheritance-resolved lookups (verb PK sets / property values) forMOO_ATTRIB_CACHE_TTLseconds. An object’s own entries are evicted on write, but a descendant’s cached lookup is not — so after a bulkmoo_init --syncthat adds or relocates verbs/properties on an ancestor, descendants can serve stale lookups until the TTL expires. Flushing gives--syncan immediate refresh across the long-running shell and celery processes without a restart.The per-process
_cached_compilelru_cache is deliberately left alone: it is keyed by verb source text, so changed source yields a new key and a fresh compile automatically.No-op when the attribute cache is disabled (
MOO_ATTRIB_CACHE_TTL == 0, e.g. tests) or the active cache backend is not Redis.- Returns:
the number of keys deleted.