Skip to content

Commit

Permalink
Refs #95020 - Speed-up cache invalidation for backward-references
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed May 25, 2018
1 parent 53f7e17 commit 4459e1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog

8.2 - (2018-05-24)
-----------------------
* Bug fix: Speed-up cache invalidation for backward-references
[avoinea refs #95020]
* Feature: replaced invalidate_cache method with a method that use eea.cache
[alecghica refs #95020]
* Feature: "Refresh this page" method redirect you back to the original context
Expand Down
12 changes: 6 additions & 6 deletions eea/cache/browser/app/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def related_items(self, context, **kwargs):
def back_refs(self, context, **kwargs):
""" Invalidate back references
"""
getBRefs = getattr(context, 'getBRefs', lambda: [])
for item in getBRefs():
getBRefs = getattr(context, 'getBRefs', lambda r: [])
for item in getBRefs('relatesTo'):
try:
uid = queryAdapter(item, IUUID)
if not uid:
Expand Down Expand Up @@ -140,8 +140,8 @@ def related_items(self, context, **kwargs):
def back_refs(self, context, **kwargs):
""" Invalidate back references
"""
getBRefs = getattr(context, 'getBRefs', lambda: [])
for item in getBRefs():
getBRefs = getattr(context, 'getBRefs', lambda r: [])
for item in getBRefs('relatesTo'):
try:
invalidate_cache = queryMultiAdapter(
(item, self.request), name='varnish.invalidate',
Expand Down Expand Up @@ -196,8 +196,8 @@ def related_items(self, context, **kwargs):
def back_refs(self, context, **kwargs):
""" Invalidate back references
"""
getBRefs = getattr(context, 'getBRefs', lambda: [])
for item in getBRefs():
getBRefs = getattr(context, 'getBRefs', lambda r: [])
for item in getBRefs('relatesTo'):
try:
invalidate_cache = queryMultiAdapter(
(item, self.request), name='cache.invalidate',
Expand Down

0 comments on commit 4459e1d

Please sign in to comment.