Fix attachment contract and reconcile storage safely across API replicas

This commit is contained in:
2026-11-06 17:41:30 +03:00
parent 057143dd91
commit cc0ef713ed
82 changed files with 1828 additions and 1054 deletions
@@ -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();
}