Skip to content

Commit

Permalink
Merge pull request #5460 from camptocamp/request-cache
Browse files Browse the repository at this point in the history
Don't use request as cache key
  • Loading branch information
sbrunner committed Nov 1, 2019
2 parents 24d5b58 + f4f9d81 commit cb241a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions geoportal/c2cgeoportal_geoportal/lib/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from dogpile.cache.util import compat
from dogpile.cache.region import make_region
from pyramid.request import Request

log = logging.getLogger(__name__)
_regions = {}
Expand Down Expand Up @@ -70,6 +71,7 @@ def generate_key(*args, **kw):
parts = [namespace]
if has_self:
args = args[1:]
args = [arg for arg in args if not isinstance(arg, Request)]
parts.extend(map(compat.text_type, map(map_dbobject, args)))
return "|".join(parts)
return generate_key
Expand Down

0 comments on commit cb241a7

Please sign in to comment.