Skip to content

Commit

Permalink
'#1224: fix NoSuchFileException thrown by re-enqueued items
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Oct 29, 2023
1 parent 964f48d commit 444e174
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SeekableByteChannel;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand Down Expand Up @@ -159,7 +160,12 @@ public SeekableInputStream getSeekableInputStream(String path) throws IOExceptio
synchronized (filesCache) {
tmp = filesCache.get(path);
if (tmp != null) {
return new SeekableFileInputStream(tmp.toFile());
try {
return new SeekableFileInputStream(tmp.toFile());
} catch (NoSuchFileException e) {
// Could have been deleted by Item.dispose()
filesCache.remove(path);
}
}
}

Expand Down

0 comments on commit 444e174

Please sign in to comment.