fix: try to fetch the upload by hash, and if no error, return the upload meta

This commit is contained in:
Derrick Hammer 2024-02-17 22:54:44 -05:00
parent 84a78b7a7e
commit cfb0abf81a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,11 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag
proof = hashResult proof = hashResult
} }
meta, err := s.metadata.GetUpload(ctx, proof.Hash)
if err == nil {
return &meta, nil
}
mimeBytes := make([]byte, 512) mimeBytes := make([]byte, 512)
_, err = io.ReadFull(data, mimeBytes) _, err = io.ReadFull(data, mimeBytes)
if err != nil { if err != nil {