mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 11:42:02 +08:00
feat: 支持在线升级功能
This commit is contained in:
@@ -328,9 +328,7 @@ impl VentoyDrive {
|
||||
let image = match VentoyImage::open(&path) {
|
||||
Ok(img) => img,
|
||||
Err(e) => {
|
||||
let _ = rt.block_on(tx.send(Err(std::io::Error::other(
|
||||
e.to_string(),
|
||||
))));
|
||||
let _ = rt.block_on(tx.send(Err(std::io::Error::other(e.to_string()))));
|
||||
return;
|
||||
}
|
||||
};
|
||||
@@ -340,9 +338,7 @@ impl VentoyDrive {
|
||||
|
||||
// Stream the file through the writer
|
||||
if let Err(e) = image.read_file_to_writer(&file_path_owned, &mut chunk_writer) {
|
||||
let _ = rt.block_on(tx.send(Err(std::io::Error::other(
|
||||
e.to_string(),
|
||||
))));
|
||||
let _ = rt.block_on(tx.send(Err(std::io::Error::other(e.to_string()))));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -545,12 +541,10 @@ mod tests {
|
||||
.output()?;
|
||||
|
||||
if !output.status.success() {
|
||||
return Err(std::io::Error::other(
|
||||
format!(
|
||||
"xz decompress failed: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
),
|
||||
));
|
||||
return Err(std::io::Error::other(format!(
|
||||
"xz decompress failed: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
)));
|
||||
}
|
||||
|
||||
std::fs::write(dst, &output.stdout)?;
|
||||
|
||||
Reference in New Issue
Block a user