From 54af24356a1e9bbf586ecb97fda10a4da47c7f9e Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Tue, 18 Jul 2023 15:22:47 +0000 Subject: [PATCH] [IMP] registry: less invalidation log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The number of invalidation during the test is quite large and the crons cal also spam this log sometimes. Waiting for further cleanup, removing this log to avoid spaming runbot logs and making them harder to read. closes odoo/odoo#128921 Signed-off-by: Xavier Dollé (xdo) --- odoo/modules/registry.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/odoo/modules/registry.py b/odoo/modules/registry.py index ce5434bbd0e..0c0c700cc65 100644 --- a/odoo/modules/registry.py +++ b/odoo/modules/registry.py @@ -708,9 +708,11 @@ class Registry(Mapping): self.cache_invalidated.add(cache_name) # log information about invalidation_cause - caller_info = format_frame(inspect.currentframe().f_back) - log = _logger.info if self.loaded else _logger.debug - log('Invalidating %s model caches from %s', ','.join(cache_names), caller_info) + if _logger.isEnabledFor(logging.DEBUG): + # could be interresting to log in info but this will need to minimize invalidation first, + # mainly in some setupclass and crons + caller_info = format_frame(inspect.currentframe().f_back) + _logger.debug('Invalidating %s model caches from %s', ','.join(cache_names), caller_info) def clear_all_caches(self): """ Clear the caches associated to methods decorated with