From ea22b3954194da6a53686d2c384ba2cc5140abd8 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 1 Apr 2010 21:41:34 +0000 Subject: [PATCH] revision 11874 is too aggressive and can kill session prematurely. Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2979748 --- .../adempiere/webui/dashboard/DashboardRunnable.java | 10 +++++++--- .../org/adempiere/webui/util/ServerPushTemplate.java | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/dashboard/DashboardRunnable.java b/zkwebui/WEB-INF/src/org/adempiere/webui/dashboard/DashboardRunnable.java index 64cecfb3f3..e85b6f5727 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/dashboard/DashboardRunnable.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/dashboard/DashboardRunnable.java @@ -75,6 +75,7 @@ public class DashboardRunnable implements Runnable, Serializable { // default Update every one minutes int interval = MSysConfig.getIntValue(ZK_DASHBOARD_REFRESH_INTERVAL, 60000); + int cumulativeFailure = 0; while(!stop) { try { Thread.sleep(interval); @@ -86,14 +87,17 @@ public class DashboardRunnable implements Runnable, Serializable Locales.setThreadLocal(locale); try { refreshDashboard(); + cumulativeFailure = 0; } catch (DesktopUnavailableException de) { - killSession(); - break; + cumulativeFailure++; } catch (Exception e) { logger.log(Level.INFO, e.getLocalizedMessage(), (e.getCause() != null ? e.getCause() : e)); - break; + cumulativeFailure++; } + if (cumulativeFailure > 3) + break; } else { + logger.log(Level.INFO, "Desktop destroy, will kill session."); killSession(); break; } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/util/ServerPushTemplate.java b/zkwebui/WEB-INF/src/org/adempiere/webui/util/ServerPushTemplate.java index af63f3270a..14b8cbc95f 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/util/ServerPushTemplate.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/util/ServerPushTemplate.java @@ -46,8 +46,8 @@ public class ServerPushTemplate { try { if (!inUIThread) { - //half second timeout - if (Executions.activate(desktop, 500)) { + //10 minutes timeout + if (Executions.activate(desktop, 10 * 60 * 1000)) { desktopActivated = true; } else { throw new DesktopUnavailableException("Timeout activating desktop.");