Skip to content

Commit

Permalink
feat($OSS): remove merged chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Aug 12, 2021
1 parent b3c2529 commit 10c65f5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion auth-center/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spring:
multipart:
# `location` specifies the directory where uploaded files will be stored. When not specified,
# a temporary directory will be used. ATTENTION: it may differ due to OS.
location: ~/Documents/@project.parent.artifactId@/${spring.application.name}/temprary-file
location: @project.parent.artifactId@/${spring.application.name}/temprary-file
# `max-file-size` specifies the maximum size permitted for uploaded files. The default is 1MB. We set it as 64 MB.
max-file-size: 64MB
# `max-request-size` specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.
Expand Down
2 changes: 1 addition & 1 deletion maf-mis/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spring:
multipart:
# `location` specifies the directory where uploaded files will be stored. When not specified,
# a temporary directory will be used. ATTENTION: it may differ due to OS.
location: ~/Documents/@project.parent.artifactId@/${spring.application.name}/temprary-file
location: @project.parent.artifactId@/${spring.application.name}/temprary-file
# `max-file-size` specifies the maximum size permitted for uploaded files. The default is 1MB. We set it as 64 MB.
max-file-size: 64MB
# `max-request-size` specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public ObjectResponse mergeResourceChunk(@Valid @NotNull MergeResourceChunkPaylo
objectResponse.setObject(objectWriteResponse.object());
objectResponse.setEtag(objectWriteResponse.etag());
log.info("Merged resource chunks. {}", objectResponse);
val errorObjectList = this.minioHelper.removeObjects(payload.getBucket(), payload.getObjectList());
log.warn("Removed unnecessary objects. errorObjectList: {}", errorObjectList);
return objectResponse;
}

Expand Down
2 changes: 1 addition & 1 deletion oss-center/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spring:
multipart:
# `location` specifies the directory where uploaded files will be stored. When not specified,
# a temporary directory will be used. ATTENTION: it may differ due to OS.
location: ~/Documents/@project.parent.artifactId@/${spring.application.name}/temprary-file
location: @project.parent.artifactId@/${spring.application.name}/temprary-file
# `max-file-size` specifies the maximum size permitted for uploaded files. The default is 1MB. We set it as 64 MB.
max-file-size: 64MB
# `max-request-size` specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public GetObjectResponse getObject(@NotBlank String bucket, @NotBlank String obj
}

@SneakyThrows
public boolean removeObject(String bucket, String object) {
public boolean removeObjects(String bucket, String object) {
if (!this.bucketExists(bucket)) {
return false;
}
Expand All @@ -168,7 +168,7 @@ public boolean removeObject(String bucket, String object) {
}

@SneakyThrows
public List<String> removeObject(String bucket, List<String> objects) {
public List<String> removeObjects(String bucket, List<String> objects) {
val deleteErrorNameList = new LinkedList<String>();
if (this.bucketExists(bucket)) {
val deleteObjectList = objects.stream().map(DeleteObject::new).collect(Collectors.toList());
Expand Down

0 comments on commit 10c65f5

Please sign in to comment.