Skip to content

Commit

Permalink
Merge pull request #7363 from filecoin-project/nonsense/fix-filepath-…
Browse files Browse the repository at this point in the history
…join

fix staging area path buildup
  • Loading branch information
magik6k authored Sep 21, 2021
2 parents 714d7a1 + c7e4217 commit fe56995
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ import (
"github.com/filecoin-project/lotus/storage"
)

var StorageCounterDSPrefix = "/storage/nextid"
var (
StorageCounterDSPrefix = "/storage/nextid"
StagingAreaDirName = "deal-staging"
)

func minerAddrFromDS(ds dtypes.MetadataDS) (address.Address, error) {
maddrb, err := ds.Get(datastore.NewKey("miner-address"))
Expand Down Expand Up @@ -536,7 +539,8 @@ func BasicDealFilter(cfg config.DealmakingConfig, user dtypes.StorageDealFilter)
return false, "miner error", err
}

diskUsageBytes, err := r.DiskUsage(r.Path() + "/deal-staging")
dir := filepath.Join(r.Path(), StagingAreaDirName)
diskUsageBytes, err := r.DiskUsage(dir)
if err != nil {
return false, "miner error", err
}
Expand Down Expand Up @@ -574,7 +578,7 @@ func StorageProvider(minerAddress dtypes.MinerAddress,
) (storagemarket.StorageProvider, error) {
net := smnet.NewFromLibp2pHost(h)

dir := filepath.Join(r.Path(), "deal-staging")
dir := filepath.Join(r.Path(), StagingAreaDirName)

// migrate temporary files that were created directly under the repo, by
// moving them to the new directory and symlinking them.
Expand Down

0 comments on commit fe56995

Please sign in to comment.