Skip to content

Commit 5f54133

Browse files
authored
Merge pull request #1524 from 0chain/feat/num-objects
Add number of files
2 parents ec7d667 + 4c8072b commit 5f54133

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

code/go/0chain.net/blobbercore/handler/storage_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ func (fsh *StorageHandler) ListEntities(ctx context.Context, r *http.Request) (*
485485
dirref = r
486486
if path == "/" {
487487
dirref.Size = allocationObj.BlobberSizeUsed
488+
dirref.NumFiles = int64(allocationObj.NumObjects)
488489
}
489490
}
490491

code/go/0chain.net/blobbercore/reference/ref.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ type Ref struct {
9595
SignatureVersion int `gorm:"column:signature_version" json:"signature_version" filelist:"signature_version"`
9696
EncryptionVersion int `gorm:"column:encryption_version" json:"encryption_version" filelist:"encryption_version"`
9797
IsEmpty bool `gorm:"-" dirlist:"is_empty"`
98+
NumFiles int64 `gorm:"-" dirlist:"num_files"`
9899
HashToBeComputed bool `gorm:"-"`
99100
prevID int64 `gorm:"-"`
100101
}

0 commit comments

Comments
 (0)