исправил баг с запуском процессов. иногда файл скриптов запускался не сразу из за запоздалого закрытия fileutils.write
This commit is contained in:
@@ -100,15 +100,27 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
|
||||
if (!file.setExecutable(true))
|
||||
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
|
||||
//--
|
||||
ProcessBuilder procBuilder = new ProcessBuilder(file.getAbsolutePath());
|
||||
procBuilder.directory(workspace);
|
||||
process = procBuilder.start();
|
||||
exit_code = process.waitFor();
|
||||
boolean flag = false;
|
||||
do {
|
||||
try {
|
||||
ProcessBuilder procBuilder = new ProcessBuilder(file.getAbsolutePath());
|
||||
procBuilder.directory(workspace);
|
||||
process = procBuilder.start();
|
||||
exit_code = process.waitFor();
|
||||
flag = true;
|
||||
} catch (Exception ex) {
|
||||
Global.Log.PrintException(ex);
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
}
|
||||
while (!flag);
|
||||
process = null;
|
||||
//---
|
||||
outputLines = new Vector<>(FileUtils.readLines(outputFile));
|
||||
errorsLines = new Vector<>(FileUtils.readLines(errorsFile));
|
||||
return (exit_code == 0) && checkLines(outputLines) && checkLines(errorsLines);
|
||||
return (exit_code == 0) &&
|
||||
checkLines(outputLines) &&
|
||||
checkLines(errorsLines);
|
||||
}
|
||||
protected boolean parse() throws Exception {
|
||||
if (performSapforScript("parse", parentTask,
|
||||
|
||||
Reference in New Issue
Block a user