Skip to content

Commit b837fe5

Browse files
committed
return size of allocation when listing root
1 parent 4875cb5 commit b837fe5

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)