From f16278cd296916fd3d6fcc6587aab42e219b2adc Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 17 Nov 2021 13:57:19 +0000 Subject: [PATCH] [IMP] web: boot: do not wait 5s to log module info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since [1], the test suite waits for 5s to start running. It's really annoying when you run the suite in your browser, to debug a single test or a sub suite. Waiting for 5s to determine whether all modules can be loaded or not is not necessary anymore since all assets coming from the same bundle are loaded in a single file, even in debug=assets. This is true under the assumption that there's no js module in assets_common requiring a module in another assets bundle, which seems reasonnable. [1] 468eb84fb413c97d3ae101a7b639d4bac6d0231d closes odoo/odoo#83805 Signed-off-by: Géry Debongnie --- addons/web/static/src/boot.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/web/static/src/boot.js b/addons/web/static/src/boot.js index 25d1c72acbb..b252b87a481 100644 --- a/addons/web/static/src/boot.js +++ b/addons/web/static/src/boot.js @@ -362,16 +362,14 @@ // Automatically log errors detected when loading modules window.addEventListener("load", function logWhenLoaded() { - setTimeout(function () { - var len = jobPromises.length; - Promise.all(jobPromises).then(function () { - if (len === jobPromises.length) { - odoo.log(); - } else { - logWhenLoaded(); - } - }); - }, 5000); + const len = jobPromises.length; + Promise.all(jobPromises).then(function () { + if (len === jobPromises.length) { + odoo.log(); + } else { + logWhenLoaded(); + } + }); }); /**