Skip to content

Commit

Permalink
WatchImporter: Use WRITE option for tryLock()
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Sep 20, 2023
1 parent 41e3d95 commit 85f27bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/bamboo/task/WatchImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void handleClosedWarc(Config.Watch watch, Path path) throws IOException
}

// Pywb flocks open files instead of renaming them, so check for a file lock
try (FileChannel channel = FileChannel.open(path, StandardOpenOption.READ)) {
try (FileChannel channel = FileChannel.open(path, StandardOpenOption.WRITE)) {
var lock = channel.tryLock();
if (lock == null) {
log.finest("WARC has file lock, treating as still open: " + path);
Expand Down

0 comments on commit 85f27bd

Please sign in to comment.