Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
feat:add upload logs
Browse files Browse the repository at this point in the history
tuwenlin committed Aug 1, 2022
1 parent 0ef9fa4 commit 05eccdd
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ public void shutdown() {
WORKSPACE_OSS_MAP.entrySet().stream().forEach(entry -> {
OSSManager ossManager = entry.getValue();
ossManager.batchUploadFile(new File(IDEA_PROJECT_PATCH));
ossManager.batchUploadFile(new File(IDEA_PROJECT_PATCH));
ossManager.batchUploadFile(new File(IDEA_CONFIG_PATCH));
});
}

@@ -170,10 +170,11 @@ public static class UploadRunnable implements Runnable {

@Override
public void run() {
LOGGER.info("WORKSPACE_OSS_MAP SIZE:{}", WORKSPACE_OSS_MAP.size());
WORKSPACE_OSS_MAP.entrySet().parallelStream().forEach(entry -> {
OSSManager ossManager = entry.getValue();
ossManager.batchUploadFile(new File(IDEA_PROJECT_PATCH));
ossManager.batchUploadFile(new File(IDEA_PROJECT_PATCH));
ossManager.batchUploadFile(new File(IDEA_CONFIG_PATCH));
});
}
}
Original file line number Diff line number Diff line change
@@ -48,10 +48,11 @@ public void batchUploadFile(File parentFile) {
if (parentFile.isDirectory()) {
File[] files = parentFile.listFiles();
for (File file : files) {
ossClient.putObject(new PutObjectRequest(bucketName, workspace + "/" + file.getPath(), file));
LOGGER.debug("will upload {} to {}", file.getAbsolutePath(), workspace + "/" + file.getAbsolutePath());
ossClient.putObject(new PutObjectRequest(bucketName, workspace + "/" + file.getAbsolutePath(), file));
}
} else {
ossClient.putObject(new PutObjectRequest(bucketName, workspace + "/" + parentFile.getPath(), parentFile));
ossClient.putObject(new PutObjectRequest(bucketName, workspace + "/" + parentFile.getAbsolutePath(), parentFile));
}
} finally {
if (ossClient != null) {

0 comments on commit 05eccdd

Please sign in to comment.