IDEMPIERE-3191:time to update performance gadget should use configuration
This commit is contained in:
parent
506c0d063d
commit
fa8188043c
|
@ -30,7 +30,6 @@ import org.compiere.util.CLogger;
|
|||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* Performance Goal
|
||||
|
@ -373,9 +372,17 @@ public class MGoal extends X_PA_Goal
|
|||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config("Force=" + force);
|
||||
MMeasure measure = MMeasure.get(getCtx(), getPA_Measure_ID());
|
||||
|
||||
boolean isUpdateByInterfal = false;
|
||||
if (getDateLastRun() != null){
|
||||
// default 30 minute 1800000
|
||||
long interval = MSysConfig.getIntValue(MSysConfig.ZK_DASHBOARD_PERFORMANCE_REFRESH_INTERVAL, 1800000);
|
||||
isUpdateByInterfal = (System.currentTimeMillis() - getDateLastRun().getTime()) > interval;
|
||||
}
|
||||
|
||||
if (force
|
||||
|| getDateLastRun() == null
|
||||
|| !TimeUtil.isSameHour(getDateLastRun(), null))
|
||||
|| isUpdateByInterfal)
|
||||
{
|
||||
measure.set_TrxName(get_TrxName());
|
||||
if (measure.updateGoals()) // saves
|
||||
|
|
|
@ -147,6 +147,7 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
public static final String ZK_BUTTON_STYLE = "ZK_BUTTON_STYLE";
|
||||
public static final String ZK_DASHBOARD_CALENDAR_REQUEST_DISPLAY_MODE = "ZK_DASHBOARD_CALENDAR_REQUEST_DISPLAY_MODE";
|
||||
public static final String ZK_DASHBOARD_PERFORMANCE_TIMEOUT = "ZK_DASHBOARD_PERFORMANCE_TIMEOUT";
|
||||
public static final String ZK_DASHBOARD_PERFORMANCE_REFRESH_INTERVAL = "ZK_DASHBOARD_PERFORMANCE_REFRESH_INTERVAL";
|
||||
public static final String ZK_DASHBOARD_REFRESH_INTERVAL = "ZK_DASHBOARD_REFRESH_INTERVAL";
|
||||
public static final String ZK_DECIMALBOX_PROCESS_DOTKEYPAD = "ZK_DECIMALBOX_PROCESS_DOTKEYPAD";
|
||||
public static final String ZK_DESKTOP_CLASS = "ZK_DESKTOP_CLASS";
|
||||
|
|
Loading…
Reference in New Issue