use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class AnalysisExecutionScheduledTaskImpl method monitorRunningAnalyses.
/**
* {@inheritDoc}
*/
@Override
public Set<Future<AnalysisSubmission>> monitorRunningAnalyses() {
synchronized (monitorRunningAnalysesLock) {
logger.trace("Running monitorRunningAnalyses");
List<AnalysisSubmission> analysisSubmissions = analysisSubmissionRepository.findByAnalysisState(AnalysisState.RUNNING);
Set<Future<AnalysisSubmission>> submissions = Sets.newHashSet();
for (AnalysisSubmission analysisSubmission : analysisSubmissions) {
logger.trace("Checking state of " + analysisSubmission);
try {
GalaxyWorkflowStatus workflowStatus = analysisExecutionService.getWorkflowStatus(analysisSubmission);
submissions.add(handleWorkflowStatus(workflowStatus, analysisSubmission));
} catch (ExecutionManagerException | RuntimeException e) {
logger.error("Error checking state for " + analysisSubmission, e);
analysisSubmission.setAnalysisState(AnalysisState.ERROR);
submissions.add(new AsyncResult<>(analysisSubmissionRepository.save(analysisSubmission)));
}
}
return submissions;
}
}
Aggregations