[PROTOBUS] Move requestTotalTasksSize to protobus (#3608)

* requestTotalTasksSize protobus migration

* Fix EmpyRequest value error

* removed hook

* Removed task size refresh actions from backend
This commit is contained in:
canvrno authored and GitHub committed 2025-05-26 14:18:53 -07:00
1 parent 35929b6869
commit a346f05e9c
8 files changed
+60 -40

No files matched your search

@@ -0,0 +1,14 @@
import { Controller } from ".."
import { EmptyRequest, Int64 } from "../../../shared/proto/common"
import { getTotalTasksSize as calculateTotalTasksSize } from "../../../utils/storage"
/**
* Gets the total size of all tasks including task data and checkpoints
* @param controller The controller instance
* @param _request The empty request
* @returns The total size as an Int64 value
*/
export async function getTotalTasksSize(controller: Controller, _request: EmptyRequest): Promise<Int64> {
const totalSize = await calculateTotalTasksSize(controller.context.globalStorageUri.fsPath)
return Int64.create({ value: totalSize || 0 })
}