adapt to the new ApiHandler variants
namely 'StreamingSync' and 'StreamingAsync' in rest-server by using the new formatter function, and in the debug binary by using 'to_value' Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
2ef2c0fe0c
commit
32e2b5abe6
@ -229,6 +229,14 @@ async fn call_api_code(
|
||||
nix::unistd::setuid(backup_user.uid)?;
|
||||
}
|
||||
match method.handler {
|
||||
ApiHandler::StreamingSync(handler) => {
|
||||
let res = (handler)(params, method, rpcenv)?.to_value()?;
|
||||
Ok(res)
|
||||
}
|
||||
ApiHandler::StreamingAsync(handler) => {
|
||||
let res = (handler)(params, method, rpcenv).await?.to_value()?;
|
||||
Ok(res)
|
||||
}
|
||||
ApiHandler::AsyncHttp(_handler) => {
|
||||
bail!("not implemented");
|
||||
}
|
||||
|
Reference in New Issue
Block a user