Skip to content

Commit 25af829

Browse files
authored
Merge pull request #1505 from 0chain/feat/root-size
return size of allocation when listing root
2 parents 4875cb5 + b837fe5 commit 25af829

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ func (fsh *StorageHandler) ListEntities(ctx context.Context, r *http.Request) (*
415415
}
416416
fileref = parent
417417
}
418+
if path == "/" {
419+
fileref.Size = allocationObj.BlobberSizeUsed
420+
}
418421
listResult.Meta = fileref.GetListingData(ctx)
419422
if clientID != allocationObj.OwnerID {
420423
delete(listResult.Meta, "path")
@@ -480,6 +483,9 @@ func (fsh *StorageHandler) ListEntities(ctx context.Context, r *http.Request) (*
480483
}
481484

482485
dirref = r
486+
if path == "/" {
487+
dirref.Size = allocationObj.BlobberSizeUsed
488+
}
483489
}
484490

485491
var result blobberhttp.ListResult

0 commit comments

Comments
 (0)