From a1f1b609af8c42830110b5cf8f294447f0dec705 Mon Sep 17 00:00:00 2001 From: hieplq Date: Mon, 6 Apr 2020 14:39:14 +0700 Subject: [PATCH] IDEMPIERE-3551: set AUTOMATIC_PACKIN_FOLDERS by system properties to override configuration on database -DAUTOMATIC_PACKIN_FOLDERS. this improve to help can test 2pack when run from idempiere without correct value on database --- .../plugin/utils/PackInApplicationActivator.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java index 5666eafabd..7470392d2e 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java @@ -342,13 +342,17 @@ public class PackInApplicationActivator extends AbstractActivator{ @Override protected void frameworkStarted() { if (service != null) { + String packinFolders = System.getProperty(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); + if (packinFolders == null || packinFolders.trim().length() == 0) { + packinFolders = MSysConfig.getValue(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); + } + final String fPackinFolders = packinFolders; if (Adempiere.getThreadPoolExecutor() != null) { Adempiere.getThreadPoolExecutor().execute(new Runnable() { @Override public void run() { int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000; - String folders = MSysConfig.getValue(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); - automaticPackin(timeout, folders, true); + automaticPackin(timeout, fPackinFolders, true); } }); } else { @@ -357,8 +361,7 @@ public class PackInApplicationActivator extends AbstractActivator{ public void stateChange(ServerStateChangeEvent event) { if (event.getEventType() == ServerStateChangeEvent.SERVER_START && service != null) { int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000; - String folders = MSysConfig.getValue(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); - automaticPackin(timeout, folders, true); + automaticPackin(timeout, fPackinFolders, true); } } });