Skip to content

Commit 8c3b8d8

Browse files
committed
Improve genome cleanup
1 parent 1631194 commit 8c3b8d8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/pipeline/AlignerIndexUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static File getIndexDir(ReferenceGenome genome, String name, boolean useW
6060
}
6161

6262
/**
63-
* If WorkDirectory is null, files will not be copied. Otherwise files be be copied to this destination.
63+
* If WorkDirectory is null, files will not be copied. Otherwise, files will be copied to this destination.
6464
*/
6565
private static boolean verifyOrCreateCachedIndex(PipelineContext ctx, @Nullable WorkDirectory wd, @Nullable AlignmentOutputImpl output, String localName, String webserverName, ReferenceGenome genome, boolean forceCopyLocal) throws PipelineJobException
6666
{
@@ -78,7 +78,7 @@ private static boolean verifyOrCreateCachedIndex(PipelineContext ctx, @Nullable
7878
File lockFile = new File(webserverIndexDir.getPath() + ".copyLock");
7979
if (lockFile.exists())
8080
{
81-
ctx.getLogger().error("Another job is actively saving this cached index. This job will skip that step; however, if this job tries to start alignment and use the index before copy is complete this might cause issues.");
81+
throw new PipelineJobException("Another job is actively saving this cached index. This error is being thrown as a precaution to avoid duplicate rsync jobs, and to prevent this job from progressing file that copy is in-progress. This job can be restarted after the copy is complete, and should resume normally.");
8282
}
8383

8484
hasCachedIndex = true;

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/CacheGenomePipelineJob.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,17 @@ public boolean isJobComplete(PipelineJob job)
185185
if (toDelete != null && toDelete.length > 0)
186186
{
187187
getJob().getLogger().info("Folders will be deleted: " + StringUtils.join(toDelete, ", "));
188-
//TODO: verify
188+
for (File x : toDelete)
189+
{
190+
try
191+
{
192+
FileUtils.deleteDirectory(x);
193+
}
194+
catch (IOException e)
195+
{
196+
throw new PipelineJobException(e);
197+
}
198+
}
189199
}
190200
}
191201

0 commit comments

Comments
 (0)