From 5e04c9cb471ac4ec22e12183e298145d17ba0601 Mon Sep 17 00:00:00 2001 From: Lorena Date: Mon, 13 May 2024 12:53:42 +0200 Subject: [PATCH] [17.0][IMP] auth_session_timeout: user websocket instead of longpolling --- auth_session_timeout/data/ir_config_parameter_data.xml | 2 +- auth_session_timeout/models/ir_config_parameter.py | 8 ++------ auth_session_timeout/tests/test_ir_config_parameter.py | 6 +----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/auth_session_timeout/data/ir_config_parameter_data.xml b/auth_session_timeout/data/ir_config_parameter_data.xml index b64c5a8c61..98bb18de77 100644 --- a/auth_session_timeout/data/ir_config_parameter_data.xml +++ b/auth_session_timeout/data/ir_config_parameter_data.xml @@ -9,6 +9,6 @@ inactive_session_time_out_ignored_url - /calendar/notify,/longpolling/poll + /calendar/notify,/websocket diff --git a/auth_session_timeout/models/ir_config_parameter.py b/auth_session_timeout/models/ir_config_parameter.py index 1f16642aee..1a7afd8bbd 100644 --- a/auth_session_timeout/models/ir_config_parameter.py +++ b/auth_session_timeout/models/ir_config_parameter.py @@ -37,10 +37,6 @@ def _auth_timeout_get_parameter_ignored_urls(self): def write(self, vals): res = super().write(vals) - self._auth_timeout_get_parameter_delay.clear_cache( - self.filtered(lambda r: r.key == DELAY_KEY), - ) - self._auth_timeout_get_parameter_ignored_urls.clear_cache( - self.filtered(lambda r: r.key == IGNORED_PATH_KEY), - ) + if DELAY_KEY == self.key or IGNORED_PATH_KEY == self.key: + self.env.registry.clear_cache() return res diff --git a/auth_session_timeout/tests/test_ir_config_parameter.py b/auth_session_timeout/tests/test_ir_config_parameter.py index fa051b2dfa..5a38a94f6b 100644 --- a/auth_session_timeout/tests/test_ir_config_parameter.py +++ b/auth_session_timeout/tests/test_ir_config_parameter.py @@ -38,11 +38,7 @@ def get_param(*args, **kwargs): return orig_get_param(*args[1:], **kwargs) orig_get_param = self.param_obj.get_param - self.param_obj._patch_method("get_param", get_param) - - def tearDown(self): - super().tearDown() - self.param_obj._revert_method("get_param") + self.patch(type(self.param_obj), "get_param", get_param) def test_auth_timeout_get_parameter_delay_cache(self): """It should cache the parameter call."""