Merge pull request #6995 from filecoin-project/feat/miner-tmp

This commit is contained in:
raulk 2021-08-06 12:07:58 +01:00 committed by GitHub
commit b418f82cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -586,7 +586,15 @@ func StorageProvider(minerAddress dtypes.MinerAddress,
dsw *dagstore.Wrapper, dsw *dagstore.Wrapper,
) (storagemarket.StorageProvider, error) { ) (storagemarket.StorageProvider, error) {
net := smnet.NewFromLibp2pHost(h) net := smnet.NewFromLibp2pHost(h)
store, err := piecefilestore.NewLocalFileStore(piecefilestore.OsPath(r.Path()))
// Create a directory under the repo path for temporary files
repoTmpPath := filepath.Join(r.Path(), "tmp")
err := os.MkdirAll(repoTmpPath, 0755) //nolint: gosec
if err != nil {
return nil, xerrors.Errorf("creating tmp dir for storage provider repo: %w", err)
}
store, err := piecefilestore.NewLocalFileStore(piecefilestore.OsPath(repoTmpPath))
if err != nil { if err != nil {
return nil, err return nil, err
} }