Skip to content

Commit 1def4a7

Browse files
committed
add workaround impl to ignore arg for cache key generation (relates to bbangert/beaker#201)
1 parent 7535627 commit 1def4a7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

magpie/adapter/magpieowssecurity.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ def __init__(self, container):
6060
self.twitcher_ssl_verify = asbool(self.settings.get("twitcher.ows_proxy_ssl_verify", True))
6161
self.twitcher_protected_path = self.settings.get("twitcher.ows_proxy_protected_path", "/ows")
6262

63-
@cache_region("service")
63+
# NOTE: Parameter 'ignore_args' is unofficial from 'https://github.com/crim-ca/beaker/commit/0ac88b'.
64+
# Using this parameter, the request UUID is ignored to avoid generating distinct cache keys for each
65+
# new inbound request, nullifying the whole point of caching similar requests to service mapping.
66+
@cache_region("service", ignore_args=["request_uuid"])
6467
def _get_service_cached(self, service_name, request_uuid):
6568
# type: (Str, uuid.UUID) -> Tuple[ServiceInterface, Dict[str, AnyValue]]
6669
"""

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ alembic>=1.3.0,<1.5
99
# leave http port until merged:
1010
authomatic[OpenID] @ https://github.com/fmigneault/authomatic/archive/httplib-port.zip
1111
bcrypt>=3.1.6
12-
beaker
12+
# FIXME: integrate when implemnted by official package (see https://github.com/bbangert/beaker/issues/201)
13+
beaker @ https://github.com/crim-ca/beaker/commit/0ac88bcd8cca063a571fc385ffbe9bcc8acaa690
1314
colander
1415
cornice<5; python_version < "3"
1516
cornice; python_version >= "3"

0 commit comments

Comments
 (0)