split out pbs-runtime module

These are mostly tokio specific "hacks" or "workarounds" we
only really need/want in our binaries without pulling it in
via our library crates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-07-06 12:08:44 +02:00
parent 01fd2447b2
commit d420962fbc
26 changed files with 50 additions and 37 deletions

View File

@ -218,7 +218,7 @@ async move {
};
if benchmark {
env.log("benchmark finished successfully");
tools::runtime::block_in_place(|| env.remove_backup())?;
pbs_runtime::block_in_place(|| env.remove_backup())?;
return Ok(());
}
@ -246,13 +246,13 @@ async move {
(Ok(_), Err(err)) => {
env.log(format!("backup ended and finish failed: {}", err));
env.log("removing unfinished backup");
tools::runtime::block_in_place(|| env.remove_backup())?;
pbs_runtime::block_in_place(|| env.remove_backup())?;
Err(err)
},
(Err(err), Err(_)) => {
env.log(format!("backup failed: {}", err));
env.log("removing failed backup");
tools::runtime::block_in_place(|| env.remove_backup())?;
pbs_runtime::block_in_place(|| env.remove_backup())?;
Err(err)
},
}

View File

@ -61,7 +61,7 @@ impl Future for UploadChunk {
let (is_duplicate, compressed_size) = match proxmox::try_block! {
let mut chunk = DataBlob::from_raw(raw_data)?;
tools::runtime::block_in_place(|| {
pbs_runtime::block_in_place(|| {
chunk.verify_unencrypted(this.size as usize, &this.digest)?;
// always comput CRC at server side