Skip to content

Commit

Permalink
[17.0][IMP] auth_session_timeout: user websocket instead of longpolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Loregs2 committed May 14, 2024
1 parent 495241a commit 5e04c9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion auth_session_timeout/data/ir_config_parameter_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</record>
<record id="inactive_session_time_out_ignored_url" model="ir.config_parameter">
<field name="key">inactive_session_time_out_ignored_url</field>
<field name="value">/calendar/notify,/longpolling/poll</field>
<field name="value">/calendar/notify,/websocket</field>
</record>
</odoo>
8 changes: 2 additions & 6 deletions auth_session_timeout/models/ir_config_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions auth_session_timeout/tests/test_ir_config_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 5e04c9c

Please sign in to comment.