diff --git a/src/main/java/edu/umn/msi/gx/java/Main.java b/src/main/java/edu/umn/msi/gx/java/Main.java index b631f4d..6a23d8b 100644 --- a/src/main/java/edu/umn/msi/gx/java/Main.java +++ b/src/main/java/edu/umn/msi/gx/java/Main.java @@ -121,7 +121,7 @@ public static void main(String[] args) throws Exception { } //wait . . . executor.shutdown(); - executor.awaitTermination(xmlTasks.size() * 120, TimeUnit.MINUTES); //2 minutes per xml handler + executor.awaitTermination(xmlTasks.size() * 120, TimeUnit.MINUTES); //120 minutes per xml handler logger.info("Finished mzIdent parsing"); DatabaseManager dbMgr = new DatabaseManager(databasePathName); @@ -168,7 +168,11 @@ public static void main(String[] args) throws Exception { executor.execute(mr); } executor.shutdown(); - executor.awaitTermination((mgfReaders.size() * 5), TimeUnit.MINUTES); //5 min max per mgf file. + boolean mgfDone = executor.awaitTermination((mgfReaders.size() * 30), TimeUnit.MINUTES); //30 min max per mgf file. + + if (!mgfDone) { + throw new Exception("Thread timeout occurred before mgfReader threads completed."); + } for (MGFReader mr : mgfReaders) { MetaTableManager.setMGFData(mr.getScans());