fix(s3): handle storage outages and check bucket readiness

This commit is contained in:
kk10
2026-11-05 11:04:41 +03:00
parent 592594ae94
commit d467cab01a
10 changed files with 127 additions and 22 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import (
"github.com/jackc/pgx/v5/pgconn"
"mtusi2026-messenger/internal/dto"
s3store "mtusi2026-messenger/internal/s3"
)
func WriteJSON(w http.ResponseWriter, status int, body any) {
@@ -51,7 +52,7 @@ func WriteInternalError(w http.ResponseWriter, requestID string, err error) {
}
func isUnavailable(err error) bool {
if errors.Is(err, context.DeadlineExceeded) {
if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, s3store.ErrUnavailable) {
return true
}