прогресс пакетов сапфор

This commit is contained in:
2024-02-16 23:49:04 +03:00
parent 0efd6ebb9b
commit cd2fefd099
3 changed files with 34 additions and 21 deletions

View File

@@ -84,17 +84,32 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
}
@Override
protected boolean CheckNextState() throws Exception {
boolean progress_changed = false;
boolean state_changed = false;
//--
File workspace = testingPackage.getLocalWorkspace();
//--
File progress = new File(workspace, "progress");
if (progress.exists()) {
String s = FileUtils.readFileToString(progress);
int current_progress = Integer.parseInt(s);
if (current_progress != testingPackage.progress) {
Print("progress changed: " + current_progress);
testingPackage.progress = current_progress;
progress_changed = true;
}
}
//--
File done = new File(workspace, Constants.DONE);
File aborted = new File(workspace, Constants.ABORTED);
if (done.exists()) {
testingPackage.state = TasksPackageState.Analysis;
return true;
state_changed = true;
} else if (aborted.exists()) {
testingPackage.state = TasksPackageState.Aborted;
return true;
state_changed = true;
}
return false;
return progress_changed || state_changed;
}
@Override
protected void DownloadResults() throws Exception {