Skip to content

Commit a7f4167

Browse files
committed
Remove done files after hashing failure/resume
1 parent 0e3ba56 commit a7f4167

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

singlecell/api-src/org/labkey/api/singlecell/pipeline/AbstractSingleCellPipelineStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ protected static File getSeuratErrorFile(SequenceOutputHandler.JobContext ctx)
544544
return new File(ctx.getOutputDir(), "seuratErrors.txt");
545545
}
546546

547-
protected void onFailure(SequenceOutputHandler.JobContext ctx) throws PipelineJobException
547+
protected void onFailure(SequenceOutputHandler.JobContext ctx, String outputPrefix) throws PipelineJobException
548548
{
549549
// This allows subclasses to implement tool-specific failure handling
550550
}
@@ -559,7 +559,7 @@ private void handlePossibleFailure(SequenceOutputHandler.JobContext ctx, String
559559
List<String> errors = IOUtils.readLines(Readers.getReader(errorFile));
560560
errorFile.delete();
561561

562-
onFailure(ctx);
562+
onFailure(ctx, outputPrefix);
563563

564564
File html = getExpectedHtmlFile(ctx, outputPrefix);
565565
if (html.exists())

singlecell/src/org/labkey/singlecell/pipeline/singlecell/RunCellHashing.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,19 @@ public String getDockerContainerName()
7272
}
7373

7474
@Override
75-
protected void onFailure(SequenceOutputHandler.JobContext ctx) throws PipelineJobException
75+
protected void onFailure(SequenceOutputHandler.JobContext ctx, String outputPrefix) throws PipelineJobException
7676
{
7777
copyHtmlLocally(ctx);
78+
79+
// Also delete the .done files, so hashing will repeat if we change params:
80+
for (File f : ctx.getOutputDir().listFiles())
81+
{
82+
if (f.getName().endsWith(CellHashingServiceImpl.CALL_EXTENSION + ".done"))
83+
{
84+
ctx.getLogger().debug("Removing hashing .done file: " + f.getName());
85+
f.delete();
86+
}
87+
}
7888
}
7989

8090
private void copyHtmlLocally(SequenceOutputHandler.JobContext ctx) throws PipelineJobException

0 commit comments

Comments
 (0)