|
|
|
@ -2,6 +2,7 @@ package org.gcube.dataanalysis.executor.rscripts.generic;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileWriter;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
@ -283,4 +284,29 @@ public abstract class GenericRScript extends StandardLocalInfraAlgorithm {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public float getStatus() {
|
|
|
|
|
try {
|
|
|
|
|
String scriptSubfolder = "";
|
|
|
|
|
int idx = mainScriptName.lastIndexOf("/");
|
|
|
|
|
if (idx > -1)
|
|
|
|
|
scriptSubfolder = mainScriptName.substring(0, idx);
|
|
|
|
|
|
|
|
|
|
if (currentFolder!=null) {
|
|
|
|
|
|
|
|
|
|
File statusFile = new File(currentFolder.getAbsolutePath()+"/"+scriptSubfolder + "/status.txt");
|
|
|
|
|
//LOGGER.debug("searching status in "+statusFile.getAbsolutePath());
|
|
|
|
|
if (statusFile.exists()) {
|
|
|
|
|
float scriptstatus = Float.parseFloat(Files.readAllLines(statusFile.toPath()).get(0));
|
|
|
|
|
LOGGER.debug("Custom status "+scriptstatus);
|
|
|
|
|
if (scriptstatus>10 && scriptstatus<100)
|
|
|
|
|
status = scriptstatus;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|