Skip to content

Commit 8bfe65a

Browse files
committed
Prevent redundant job submissions
1 parent eb987fd commit 8bfe65a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

SequenceAnalysis/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dependencies {
9090
BuildUtils.addExternalDependency(
9191
project,
9292
new ExternalDependency(
93-
"com.github.broadinstitute:picard:2.22.4",
93+
"com.github.broadinstitute:picard:2.26.10",
9494
"Picard Tools Lib",
9595
"PicardTools",
9696
"https://github.com/broadinstitute/picard",

cluster/src/org/labkey/cluster/ClusterController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@
4949

5050
import java.io.File;
5151
import java.util.ArrayList;
52+
import java.util.Arrays;
5253
import java.util.HashMap;
54+
import java.util.HashSet;
5355
import java.util.List;
5456
import java.util.Map;
57+
import java.util.Set;
5558

5659
public class ClusterController extends SpringActionController
5760
{
@@ -127,8 +130,9 @@ public boolean handlePost(JobIdsForm form, BindException errors) throws Exceptio
127130
return false;
128131
}
129132

133+
Set<String> jobs = new HashSet<>(Arrays.asList(jobIDs.split(",")));
130134
List<PipelineStatusFile> sfs = new ArrayList<>();
131-
for (String id : jobIDs.split(","))
135+
for (String id : jobs)
132136
{
133137
int jobId = Integer.parseInt(StringUtils.trimToNull(id));
134138
PipelineStatusFile sf = PipelineService.get().getStatusFile(jobId);
@@ -277,7 +281,7 @@ public ModelAndView getConfirmView(JobIdsForm form, BindException errors) throws
277281
{
278282
return new HtmlView(HtmlString.unsafe("This will attempt to re-queue existing pipeline jobs using their serialized JSON text files. It is intended as a workaround for the situation where a job has been marked complete." +
279283
"To continue, enter a comma-delimited list of Job IDs and hit submit:<br><br>" +
280-
"<label>Enter Job ID(s): </label><input name=\"jobIds\" value=\"" + form.getJobIds() + "\"><br>"));
284+
"<label>Enter Job ID(s): </label><input name=\"jobIds\" value=\"" + HtmlString.of(form.getJobIds()) + "\"><br>"));
281285
}
282286

283287
public boolean handlePost(JobIdsForm form, BindException errors) throws Exception
@@ -289,8 +293,9 @@ public boolean handlePost(JobIdsForm form, BindException errors) throws Exceptio
289293
return false;
290294
}
291295

296+
Set<String> jobs = new HashSet<>(Arrays.asList(jobIDs.split(",")));
292297
List<PipelineStatusFile> sfs = new ArrayList<>();
293-
for (String id : jobIDs.split(","))
298+
for (String id : jobs)
294299
{
295300
int jobId = Integer.parseInt(StringUtils.trimToNull(id));
296301
PipelineStatusFile sf = PipelineService.get().getStatusFile(jobId);

0 commit comments

Comments
 (0)