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
This commit is contained in:
hieplq 2020-04-06 14:39:14 +07:00 committed by Carlos Ruiz
parent d5a82db8b1
commit a1f1b609af
1 changed files with 7 additions and 4 deletions

View File

@ -342,13 +342,17 @@ public class PackInApplicationActivator extends AbstractActivator{
@Override @Override
protected void frameworkStarted() { protected void frameworkStarted() {
if (service != null) { 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) { if (Adempiere.getThreadPoolExecutor() != null) {
Adempiere.getThreadPoolExecutor().execute(new Runnable() { Adempiere.getThreadPoolExecutor().execute(new Runnable() {
@Override @Override
public void run() { public void run() {
int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000; int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000;
String folders = MSysConfig.getValue(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); automaticPackin(timeout, fPackinFolders, true);
automaticPackin(timeout, folders, true);
} }
}); });
} else { } else {
@ -357,8 +361,7 @@ public class PackInApplicationActivator extends AbstractActivator{
public void stateChange(ServerStateChangeEvent event) { public void stateChange(ServerStateChangeEvent event) {
if (event.getEventType() == ServerStateChangeEvent.SERVER_START && service != null) { if (event.getEventType() == ServerStateChangeEvent.SERVER_START && service != null) {
int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000; int timeout = MSysConfig.getIntValue(MSysConfig.AUTOMATIC_PACKIN_INITIAL_DELAY, 120) * 1000;
String folders = MSysConfig.getValue(MSysConfig.AUTOMATIC_PACKIN_FOLDERS); automaticPackin(timeout, fPackinFolders, true);
automaticPackin(timeout, folders, true);
} }
} }
}); });