Skip to content

Commit

Permalink
fix: log added at rsync streaming point
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyadip007 authored Nov 11, 2024
1 parent 96b9308 commit 2a73cb6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/io/spaship/sidecar/services/RequestProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ private void rsync(String source, String destination) throws IOException, Interr
LOG.info("RSync processBuilder startpoint 3");
int exitCode = process.waitFor();
LOG.info("RSync processBuilder startpoint 4");

try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {

String line;
while ((line = reader.readLine()) != null) {
LOG.info("RSync output: {}", line);
}

while ((line = errorReader.readLine()) != null) {
LOG.error("RSync error: {}", line);
}
}

if (exitCode == 0) {
LOG.info("Synchronization completed successfully.");
} else {
Expand Down

0 comments on commit 2a73cb6

Please sign in to comment.