Skip to content

Commit

Permalink
race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sikina committed Dec 21, 2023
1 parent c4a248d commit 0d23a6e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ private boolean writeStreamToFile(String fileName, InputStream content, String q

try {
LOG.info("Writing query {} to file: {}", queryId, filePath);
if (!Files.exists(dirPath)) {
Files.createDirectory(dirPath);
synchronized (dirPath) {
if (!Files.exists(dirPath)) {
Files.createDirectory(dirPath);
}
}
return Files.copy(content, filePath) > 0;
} catch (IOException e) {
Expand Down

0 comments on commit 0d23a6e

Please sign in to comment.