fix: try to fetch the upload by hash, and if no error, return the upload meta
This commit is contained in:
parent
84a78b7a7e
commit
cfb0abf81a
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue