Skip to content

Commit

Permalink
Remove possible vertx thread blocking.
Browse files Browse the repository at this point in the history
  • Loading branch information
CTMBNara committed Nov 7, 2024
1 parent e7745d4 commit a6cacbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void sync(RetryPolicy currentRetryPolicy) {

private Future<?> processFile(String filePath) {
return filePath != null
? fileProcessor.setDataPath(filePath)
? vertx.executeBlocking(() -> fileProcessor.setDataPath(filePath))
.onFailure(error -> logger.error("Can't process saved file: " + filePath))
: Future.succeededFuture();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void sync() {
}

private Future<Void> processSavedFile() {
return processor.setDataPath(saveFilePath)
return vertx.executeBlocking(() -> processor.setDataPath(saveFilePath))
.onFailure(error -> logger.error("Can't process saved file: " + saveFilePath))
.recover(ignored -> deleteFile(saveFilePath).mapEmpty())
.mapEmpty();
Expand Down

0 comments on commit a6cacbf

Please sign in to comment.