Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ public void submitJob(final String jobID, final String scriptName) {
runner = new BatchRunner();
runner.start();
}
synchronized (this) {
synchronized (this){
jobs.add(new BatchJob(jobData));
}
}

public BatchJob getJob(final String jobID) {
public synchronized BatchJob getJob(final String jobID) {
return jobs.stream()
.filter(job -> job.getData().getJobID().equals(jobID))
.findFirst()
.orElse(null);
}

public List<BatchJob> getUnfinishedJobs() {
public synchronized List<BatchJob> getUnfinishedJobs() {
return jobs.stream()
.filter(job -> !job.isTerminated())
.collect(Collectors.toList());
Expand Down
Loading