add diskUsage effect (#2297)

This commit is contained in:
Aiden McClelland
2023-06-09 21:46:44 +00:00
committed by Matt Hill
parent 26ddf769b1
commit 71a15cf222
6 changed files with 112 additions and 2 deletions

View File

@@ -185,6 +185,14 @@ const runRsync = (
}
};
const diskUsage = async ({
volumeId = requireParam("volumeId"),
path = requireParam("path"),
} = { volumeId: null, path: null }) => {
const [used, total] = await Deno.core.opAsync("disk_usage", volumeId, path);
return { used, total }
}
const currentFunction = Deno.core.opSync("current_function");
const input = Deno.core.opSync("get_input");
const variable_args = Deno.core.opSync("get_variable_args");
@@ -213,7 +221,8 @@ const effects = {
runDaemon,
signalGroup,
runRsync,
readDir
readDir,
diskUsage,
};
const defaults = {