Invalidate domains cache when received an event affecting it
When events handling is enabled, use it for cache invalidation too.
This commit is contained in:
parent
57b87da9d1
commit
88b559d985
@ -176,8 +176,13 @@ class EventsDispatcher(object):
|
||||
def handle(self, subject, event, **kwargs):
|
||||
'''Call handlers for given event'''
|
||||
if subject:
|
||||
if event in ['property-set:name']:
|
||||
self.app.domains.clear_cache()
|
||||
subject = self.app.domains[subject]
|
||||
else:
|
||||
# handle cache refreshing on best-effort basis
|
||||
if event in ['domain-add', 'domain-delete']:
|
||||
self.app.domains.clear_cache()
|
||||
subject = None
|
||||
for handler in self.handlers.get(event, []):
|
||||
handler(subject, event, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user