From 19e200089d072bc8f2e01be5174cc9d059903621 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 6 Mar 2008 04:25:16 +0000 Subject: [PATCH] [ 1717125 ] Frequently checking for new Requests/Notices - Implemented sysconfig parameter MENU_INFOUPDATER_SLEEP_MS to allow parameterization of the wait seconds. - Implemented also in MSysConfig the cache of not found keys. --- base/src/org/compiere/model/MSysConfig.java | 5 +++++ client/src/org/compiere/apps/AMenu.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/base/src/org/compiere/model/MSysConfig.java b/base/src/org/compiere/model/MSysConfig.java index 285fea9fd4..ce3082d88e 100644 --- a/base/src/org/compiere/model/MSysConfig.java +++ b/base/src/org/compiere/model/MSysConfig.java @@ -263,6 +263,9 @@ public class MSysConfig extends X_AD_SysConfig String str = s_cache.get(key); if (str != null) return str; + if (str == null && s_cache.containsKey(key)) // found null key + return defaultValue; + // String sql = "SELECT Value FROM AD_SysConfig" + " WHERE Name=? AND AD_Client_ID IN (0, ?) AND AD_Org_ID IN (0, ?) AND IsActive='Y'" @@ -295,6 +298,8 @@ public class MSysConfig extends X_AD_SysConfig return str; } else { + // anyways, put the not found key as null + s_cache.put(key, null); return defaultValue; } } diff --git a/client/src/org/compiere/apps/AMenu.java b/client/src/org/compiere/apps/AMenu.java index 436a37342e..ed86cc0a35 100644 --- a/client/src/org/compiere/apps/AMenu.java +++ b/client/src/org/compiere/apps/AMenu.java @@ -57,6 +57,7 @@ import org.compiere.apps.wf.WFPanel; import org.compiere.grid.tree.VTreePanel; import org.compiere.model.MRole; import org.compiere.model.MSession; +import org.compiere.model.MSysConfig; import org.compiere.model.MSystem; import org.compiere.model.MTreeNode; import org.compiere.model.MUser; @@ -774,7 +775,7 @@ public final class AMenu extends CFrame updateInfo(); try { - Thread.sleep(60000); + Thread.sleep(MSysConfig.getIntValue("MENU_INFOUPDATER_SLEEP_MS", 60000, Env.getAD_Client_ID(Env.getCtx()))); } catch(InterruptedException ire) { } } }