From 12b19bdf643056c2b749515d14f2dd305f7bb0a0 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 29 Mar 2023 18:41:30 +0800 Subject: [PATCH] third --- internal/rpc/third/s3.go | 3 +-- pkg/common/db/controller/storage.go | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/rpc/third/s3.go b/internal/rpc/third/s3.go index de67f01b6..21471e00d 100644 --- a/internal/rpc/third/s3.go +++ b/internal/rpc/third/s3.go @@ -29,8 +29,7 @@ func (t *thirdServer) GetUrl(ctx context.Context, req *third.GetUrlReq) (*third. } func (t *thirdServer) GetHashInfo(ctx context.Context, req *third.GetHashInfoReq) (*third.GetHashInfoResp, error) { - - return nil, nil + return t.s3dataBase.GetHashInfo(ctx, req) } func (t *thirdServer) CleanObject(ctx context.Context, now time.Time) { diff --git a/pkg/common/db/controller/storage.go b/pkg/common/db/controller/storage.go index 60cd317bd..ceedf5d15 100644 --- a/pkg/common/db/controller/storage.go +++ b/pkg/common/db/controller/storage.go @@ -463,6 +463,9 @@ func (c *s3Database) clearNoCitation(ctx context.Context, engine string, limit i } func (c *s3Database) GetHashInfo(ctx context.Context, req *third.GetHashInfoReq) (*third.GetHashInfoResp, error) { + if err := c.CheckHash(req.Hash); err != nil { + return nil, err + } o, err := c.hash.Take(ctx, req.Hash, c.obj.Name()) if err != nil { return nil, err