From 95b1d09a3c46997a38a0cb26cc5d8522fae1279d Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 12 Jul 2023 11:06:41 +0800 Subject: [PATCH] s3 debug log --- internal/rpc/third/s3.go | 4 ++++ pkg/common/db/s3/cont/controller.go | 1 + 2 files changed, 5 insertions(+) diff --git a/internal/rpc/third/s3.go b/internal/rpc/third/s3.go index bf4e81b40..beb114c7a 100644 --- a/internal/rpc/third/s3.go +++ b/internal/rpc/third/s3.go @@ -4,6 +4,7 @@ import ( "context" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext" "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third" @@ -29,6 +30,7 @@ func (t *thirdServer) PartSize(ctx context.Context, req *third.PartSizeReq) (*th } func (t *thirdServer) InitiateMultipartUpload(ctx context.Context, req *third.InitiateMultipartUploadReq) (*third.InitiateMultipartUploadResp, error) { + log.ZDebug(ctx, "return") if err := checkUploadName(ctx, req.Name); err != nil { return nil, err } @@ -81,6 +83,7 @@ func (t *thirdServer) InitiateMultipartUpload(ctx context.Context, req *third.In } func (t *thirdServer) AuthSign(ctx context.Context, req *third.AuthSignReq) (*third.AuthSignResp, error) { + log.ZDebug(ctx, "return") partNumbers := utils.Slice(req.PartNumbers, func(partNumber int32) int { return int(partNumber) }) result, err := t.s3dataBase.AuthSign(ctx, req.UploadID, partNumbers) if err != nil { @@ -104,6 +107,7 @@ func (t *thirdServer) AuthSign(ctx context.Context, req *third.AuthSignReq) (*th } func (t *thirdServer) CompleteMultipartUpload(ctx context.Context, req *third.CompleteMultipartUploadReq) (*third.CompleteMultipartUploadResp, error) { + log.ZDebug(ctx, "return") if err := checkUploadName(ctx, req.Name); err != nil { return nil, err } diff --git a/pkg/common/db/s3/cont/controller.go b/pkg/common/db/s3/cont/controller.go index 9ff0bfdfb..513b90bb6 100644 --- a/pkg/common/db/s3/cont/controller.go +++ b/pkg/common/db/s3/cont/controller.go @@ -57,6 +57,7 @@ func (c *Controller) GetHashObject(ctx context.Context, hash string) (*s3.Object } func (c *Controller) InitiateUpload(ctx context.Context, hash string, size int64, expire time.Duration, maxParts int) (*InitiateUploadResult, error) { + log.ZDebug(ctx, "return") if size < 0 { return nil, errors.New("invalid size") }