add more deadlines and pass around context under most situations (#19752)

This commit is contained in:
Harshavardhana
2024-05-15 15:19:00 -07:00
committed by GitHub
parent 69c9496c71
commit 0b3eb7f218
9 changed files with 150 additions and 104 deletions
+11 -3
View File
@@ -2,7 +2,9 @@ package cmd
import (
"context"
"errors"
"github.com/minio/minio/internal/grid"
"github.com/minio/minio/internal/logger"
)
@@ -43,15 +45,21 @@ func authZLogIf(ctx context.Context, err error, errKind ...interface{}) {
}
func peersLogIf(ctx context.Context, err error, errKind ...interface{}) {
logger.LogIf(ctx, "peers", err, errKind...)
if !errors.Is(err, grid.ErrDisconnected) {
logger.LogIf(ctx, "peers", err, errKind...)
}
}
func peersLogAlwaysIf(ctx context.Context, err error, errKind ...interface{}) {
logger.LogAlwaysIf(ctx, "peers", err, errKind...)
if !errors.Is(err, grid.ErrDisconnected) {
logger.LogAlwaysIf(ctx, "peers", err, errKind...)
}
}
func peersLogOnceIf(ctx context.Context, err error, id string, errKind ...interface{}) {
logger.LogOnceIf(ctx, "peers", err, id, errKind...)
if !errors.Is(err, grid.ErrDisconnected) {
logger.LogOnceIf(ctx, "peers", err, id, errKind...)
}
}
func bugLogIf(ctx context.Context, err error, errKind ...interface{}) {