Skip to content

Commit ef0d1cb

Browse files
committed
Improve handling of mGAP releases with or without lucene indexes
1 parent a3ac5b7 commit ef0d1cb

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

jbrowse/src/org/labkey/jbrowse/model/JsonFile.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,10 +964,23 @@ public File prepareResource(User u, Logger log, boolean throwIfNotPrepared, bool
964964
}
965965
else if (existingLuceneDir != null && existingLuceneDir.exists())
966966
{
967+
if (doesLuceneIndexExist())
968+
{
969+
log.info("Deleting existing lucene index dir: " + luceneDir.getPath());
970+
try
971+
{
972+
FileUtils.deleteDirectory(luceneDir);
973+
}
974+
catch (IOException e)
975+
{
976+
throw new PipelineJobException(e);
977+
}
978+
}
979+
967980
log.debug("Creating symlink to existing index: " + existingLuceneDir.getPath());
968981
try
969982
{
970-
Files.createSymbolicLink(existingLuceneDir.toPath(), existingLuceneDir.toPath());
983+
Files.createSymbolicLink(existingLuceneDir.toPath(), luceneDir.toPath());
971984
}
972985
catch (IOException e)
973986
{

0 commit comments

Comments
 (0)