fix: forgot to return UploadMetadata
This commit is contained in:
parent
cfb0abf81a
commit
a20b79ff90
|
@ -171,6 +171,13 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uploadMeta := &metadata.UploadMetadata{
|
||||||
|
Protocol: protocolName,
|
||||||
|
Hash: proof.Hash,
|
||||||
|
MimeType: mimeType,
|
||||||
|
Size: uint64(proof.Length),
|
||||||
|
}
|
||||||
|
|
||||||
if muParams != nil {
|
if muParams != nil {
|
||||||
muParams.FileName = filename
|
muParams.FileName = filename
|
||||||
muParams.Bucket = protocolName
|
muParams.Bucket = protocolName
|
||||||
|
@ -180,12 +187,7 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &metadata.UploadMetadata{
|
return uploadMeta, nil
|
||||||
Protocol: protocolName,
|
|
||||||
Hash: proof.Hash,
|
|
||||||
MimeType: mimeType,
|
|
||||||
Size: uint64(proof.Length),
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.renter.UploadObject(ctx, reader, protocolName, filename)
|
err = s.renter.UploadObject(ctx, reader, protocolName, filename)
|
||||||
|
@ -193,7 +195,7 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil
|
return uploadMeta, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s StorageServiceDefault) UploadObjectProof(ctx context.Context, protocol StorageProtocol, data io.ReadSeeker, proof *bao.Result) error {
|
func (s StorageServiceDefault) UploadObjectProof(ctx context.Context, protocol StorageProtocol, data io.ReadSeeker, proof *bao.Result) error {
|
||||||
|
|
Loading…
Reference in New Issue