Changeset 29356 for main/trunk/gli


Ignore:
Timestamp:
10/08/14 20:20:05 (6 years ago)
Author:
ak19
Message:

Non-crucial commit, but I believe it may still be better to waitFor() the ant stop/start Process to finish before continuing to call other code.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r29238 r29356  
    743743            } else {
    744744                p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant stop -f \"" + Configuration.gsdl3_src_path + File.separator + "build.xml\""});
     745            }
     746            if(p != null && p.waitFor() == 0) {
     747                DebugStream.println("********** SUCCESSFULLY stopped THE GS3 SERVER ON EXIT");
     748            }
     749            else {
     750                System.err.println("********** FAILED TO SUCCESSFULLY stop THE GS3 SERVER ON EXIT");
     751                //throw new Exception ("Failed to successfully stop the GS3 server on exit.");
    745752            }
    746753            } catch(Exception e) {
  • main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java

    r29222 r29356  
    7676            p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant " + _ant_command + " -f \"" + _gsdl3_src_path + File.separator + "build.xml\""});
    7777            }
     78
     79        if (p != null) {
     80            int result = p.waitFor();
     81            if(result != 0) {
     82            System.err.println("**** Failed to successfully " + _ant_command + " the GS3 server.");
     83            }
     84        } else {
     85            System.err.println("**** Could not start the Process to " + _ant_command + " the GS3 server.");
     86        }
     87
    7888        }
    7989    catch(Exception ex)
Note: See TracChangeset for help on using the changeset viewer.