Fix attachment contract and reconcile storage safely across API replicas
This commit is contained in:
@@ -15,10 +15,18 @@ public class HealthService {
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final DataSource dataSource;
|
||||
private final io.minio.MinioClient minio;
|
||||
private final ru.mtusi.messenger.config.properties.S3Properties s3;
|
||||
|
||||
public HealthDTO readiness() {
|
||||
requirePoolAvailable();
|
||||
requireDatabaseReachable();
|
||||
try {
|
||||
if (!minio.bucketExists(io.minio.BucketExistsArgs.builder().bucket(s3.bucket()).build()))
|
||||
throw new ServiceUnavailableException("Storage unavailable");
|
||||
} catch (Exception e) {
|
||||
throw new ServiceUnavailableException("Storage unavailable");
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user