From 3d70b5dd631d53e98c68df926e77e53aa80d58bf Mon Sep 17 00:00:00 2001 From: hengsin Date: Sun, 31 Jan 2021 15:56:22 +0800 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-4676=20Browser=20hangs=20after=20rest?= =?UTF-8?q?arting=20iDempiere=20or=20refreshing=E2=80=A6=20(#557)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-4676 Browser hangs after restarting iDempiere or refreshing ui.zk, on macos sometimes during work * IDEMPIERE-4678 Save log informing Notice created when background job stop immediately when server is not reachable --- .../WEB-INF/src/metainfo/zk/lang-addon.xml | 2 +- .../src/web/js/jawwa/atmosphere/serverpush.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index 48dd2b0364..01c88c10cd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -45,7 +45,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js b/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js index 54e42e624d..75ed4421f7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js +++ b/org.adempiere.ui.zk/WEB-INF/src/web/js/jawwa/atmosphere/serverpush.js @@ -40,13 +40,15 @@ var me = this; this.ajaxOptions.error = function(jqxhr, textStatus, errorThrown) { if (me.trace) - console.log("error: " + textStatus + " dtid: " + me.desktop.id + " errorThrown: " + errorThrown); + console.log("error: " + textStatus + " dtid: " + me.desktop.id + " errorThrown: " + errorThrown + " status: " + jqxhr.status); if (textStatus != "timeout" && textStatus != "abort" && errorThrown != "SessionNotFound") { - if (typeof console == "object") { - console.error(textStatus); - console.error(errorThrown); + console.error("error: " + textStatus + " errorThrown: " + errorThrown + " status: " + jqxhr.status); + //stop immediately if server is not reachable + if (jqxhr.status == 404 || jqxhr.status == 0) { + me.failures = 3; + } else { + me.failures += 1; } - me.failures += 1; } }; this.ajaxOptions.success = function(data) { @@ -69,7 +71,7 @@ }; }, _schedule: function() { - if (this.failures < 20) { + if (this.failures < 3) { this._req = null; setTimeout(this.proxy(this._send), this.delay); } else {