fix(health): check the active storage provider
Heimdall Gitea / Build and tests (pull_request) Successful in 15m57s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Successful in 7m56s
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 9m9s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped

This commit is contained in:
Arnaud Dartois committed 2026-10-24 21:47:40 +02:00
1 parent cc6cbeccf5
commit 2d2e5bc211
7 files changed
+73 -51

No files matched your search

@@ -194,12 +194,20 @@ public sealed class AlarikStorageProvider : IStorageProvider, IDisposable
return false;
try
{
await _client.ListBucketsAsync(ct).ConfigureAwait(false);
await _client.ListObjectsV2Async(new ListObjectsV2Request
{
BucketName = _bucket,
MaxKeys = 1,
}, ct).ConfigureAwait(false);
return true;
}
catch (OperationCanceledException) when (ct.IsCancellationRequested)
{
throw;
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Alarik/S3 health check failed");
_logger.LogWarning(ex, "S3 storage bucket health check failed");
return false;
}
}