Add configuration of select timeout for cache channels

This commit is contained in:
Cédric Krier committed 2025-03-04 23:08:13 +01:00
1 parent 723a820494
commit 881df99a24
4 files changed
+13 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Add configuration of select timeout for cache channels
* Add color as type of icon and image
* Add color widget to form view
* Limit access to database from the same series
+9
View File
@@ -412,6 +412,15 @@ channels if the back-end supports them.
Default: ``300``
.. _config-cache.select_timeout:
select_timeout
~~~~~~~~~~~~~~
The timeout duration of the select call when using channels.
Default: ``60``
.. _config-cache.count_timeout:
count_timeout
+2 -1
View File
@@ -22,6 +22,7 @@ from trytond.transaction import Transaction
__all__ = ['BaseCache', 'Cache', 'LRUDict', 'LRUDictTransaction']
_clear_timeout = config.getint('cache', 'clean_timeout', default=5 * 60)
_select_timeout = config.getint('cache', 'select_timeout')
_default_size_limit = config.getint('cache', 'default')
logger = logging.getLogger(__name__)
@@ -401,7 +402,7 @@ class MemoryCache(BaseCache):
selector.register(conn, selectors.EVENT_READ)
while cls._listener.get((pid, dbname)) == current_thread:
selector.select(timeout=60)
selector.select(timeout=_select_timeout)
conn.poll()
while conn.notifies:
notification = conn.notifies.pop()
+1
View File
@@ -75,6 +75,7 @@ class TrytonConfigParser(configparser.ConfigParser):
self.set('cache', 'default', '1024')
self.set('cache', 'ir.message', '10240')
self.set('cache', 'ir.translation', '10240')
self.set('cache', 'select_timeout', '60')
self.add_section('queue')
self.set('queue', 'worker', 'False')
self.add_section('ssl')