mirror of
https://github.com/halo-dev/plugin-s3.git
synced 2025-10-15 14:40:46 +00:00
Compare commits
2 Commits
v1.13.0-rc
...
v1.13.0-rc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
42e27da86b | ||
![]() |
19469d0537 |
11
build.gradle
11
build.gradle
@@ -1,17 +1,8 @@
|
||||
// TODO Remove the buildscript block when the halo devtools plugin is updated to use ASM 9.5 or later.
|
||||
buildscript {
|
||||
dependencies {
|
||||
// force the version of ASM used by the halo devtools plugin
|
||||
classpath('org.ow2.asm:asm:9.8')
|
||||
classpath('org.ow2.asm:asm-commons:9.8')
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id "com.github.node-gradle.node" version "7.1.0"
|
||||
id "io.freefair.lombok" version "8.13.1"
|
||||
id "run.halo.plugin.devtools" version "0.5.0"
|
||||
id "run.halo.plugin.devtools" version "0.6.0"
|
||||
id 'org.openapi.generator' version '7.12.0'
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
|
||||
mavenCentral()
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/repository/spring-plugin' }
|
||||
@@ -9,4 +8,3 @@ pluginManagement {
|
||||
}
|
||||
}
|
||||
rootProject.name = 'plugin-s3'
|
||||
|
||||
|
@@ -91,13 +91,16 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
|
||||
return Mono.just(context);
|
||||
}
|
||||
var properties = S3OsProperties.convertFrom(deleteContext.configMap());
|
||||
return Mono.using(() -> buildS3Client(properties),
|
||||
return Mono.using(
|
||||
() -> buildS3Client(properties),
|
||||
client -> Mono.fromCallable(
|
||||
() -> client.deleteObject(DeleteObjectRequest.builder()
|
||||
.bucket(properties.getBucket())
|
||||
.key(objectKey)
|
||||
.build())).subscribeOn(Schedulers.boundedElastic()),
|
||||
S3Client::close)
|
||||
.build())),
|
||||
S3Client::close
|
||||
)
|
||||
.subscribeOn(Schedulers.boundedElastic())
|
||||
.doOnNext(response -> {
|
||||
checkResult(response, "delete object");
|
||||
log.info("Delete object {} from bucket {} successfully",
|
||||
@@ -105,8 +108,10 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
|
||||
})
|
||||
.thenReturn(context);
|
||||
})
|
||||
// ignore when the object does not exist
|
||||
.onErrorComplete(NoSuchKeyException.class::isInstance)
|
||||
.onErrorMap(S3ExceptionHandler::map)
|
||||
.map(DeleteContext::attachment);
|
||||
.thenReturn(deleteContext.attachment());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user