diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index e35b520cef..45c5c28454 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -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 diff --git a/trytond/doc/topics/configuration.rst b/trytond/doc/topics/configuration.rst index 555f7021cd..211735728e 100644 --- a/trytond/doc/topics/configuration.rst +++ b/trytond/doc/topics/configuration.rst @@ -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 diff --git a/trytond/trytond/cache.py b/trytond/trytond/cache.py index b37494cf45..5c16513bb4 100644 --- a/trytond/trytond/cache.py +++ b/trytond/trytond/cache.py @@ -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() diff --git a/trytond/trytond/config.py b/trytond/trytond/config.py index abe651f05b..c23506451f 100644 --- a/trytond/trytond/config.py +++ b/trytond/trytond/config.py @@ -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')