From cfb0abf81a753159bed871cebc859e43e1812915 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 17 Feb 2024 22:54:44 -0500 Subject: [PATCH] fix: try to fetch the upload by hash, and if no error, return the upload meta --- storage/storage.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/storage.go b/storage/storage.go index 2777cff..81b7613 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -138,6 +138,11 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag proof = hashResult } + meta, err := s.metadata.GetUpload(ctx, proof.Hash) + if err == nil { + return &meta, nil + } + mimeBytes := make([]byte, 512) _, err = io.ReadFull(data, mimeBytes) if err != nil {