Fixed issue 19661. Build requests will be ignored while a build is running
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 15 Feb 2012 12:19:15 +0100
changeset 15501 6b84612a26a3
parent 15500 ff7ef6b1079f
child 15502 26012ec9699f
Fixed issue 19661. Build requests will be ignored while a build is running
src/org/openbravo/erpCommon/ad_process/ApplyModules.java
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Mon Feb 13 13:37:52 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Wed Feb 15 12:19:15 2012 +0100
@@ -394,6 +394,9 @@
    */
   private void startApply(HttpServletResponse response, VariablesSecureApp vars)
       throws IOException, ServletException {
+    if (vars.getSessionValue("ApplyModules|BuildRunning").equals("Y")) {
+      return;
+    }
 
     OBContext.setAdminMode();
     PreparedStatement ps3 = null;
@@ -424,6 +427,7 @@
       final Vector<String> tasks = new Vector<String>();
       tasks.add("UIrebuild");
 
+      vars.setSessionValue("ApplyModules|BuildRunning", "Y");
       ant.runTask(tasks);
 
       vars.setSessionValue("ApplyModules|ProcessFinished", "Y");
@@ -435,6 +439,7 @@
       createModuleLog(false, e.getMessage());
       OBDal.getInstance().commitAndClose();
     } finally {
+      vars.setSessionValue("ApplyModules|BuildRunning", "");
       try {
         Properties props = new Properties();
         props.setProperty("log4j.rootCategory", "INFO,R");