mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-22 11:22:59 +03:00
app_store: dont save the zip file
This commit is contained in:
parent
1a187d8565
commit
477d02ac7a
@ -404,7 +404,7 @@ fn handle_remote_request(
|
|||||||
},
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
let file_name = format!("/api-{}-v0.1.0.zip", package_id); // TODO: actual version
|
let file_name = format!("/{}-v0.1.0-api.zip", package_id); // TODO: actual version
|
||||||
// get the .zip from VFS and attach as blob to response
|
// get the .zip from VFS and attach as blob to response
|
||||||
let file_path = format!("/{}/pkg/api.zip", package_id);
|
let file_path = format!("/{}/pkg/api.zip", package_id);
|
||||||
let Ok(Ok(_)) = Request::to(("our", "vfs", "distro", "sys"))
|
let Ok(Ok(_)) = Request::to(("our", "vfs", "distro", "sys"))
|
||||||
@ -469,8 +469,8 @@ fn handle_local_request(
|
|||||||
let result = Request::new()
|
let result = Request::new()
|
||||||
.target(("our", "vfs", "distro", "sys"))
|
.target(("our", "vfs", "distro", "sys"))
|
||||||
.body(serde_json::to_vec(&vfs::VfsRequest {
|
.body(serde_json::to_vec(&vfs::VfsRequest {
|
||||||
path: format!("{}/api.zip", drive_path),
|
path: format!("{}/api", drive_path),
|
||||||
action: vfs::VfsAction::Len,
|
action: vfs::VfsAction::Metadata,
|
||||||
}).unwrap())
|
}).unwrap())
|
||||||
.send_and_await_response(5);
|
.send_and_await_response(5);
|
||||||
if let Ok(Ok(_)) = result {
|
if let Ok(Ok(_)) = result {
|
||||||
@ -670,7 +670,7 @@ fn handle_receive_download(
|
|||||||
let package_name = package_name[1..].trim_end_matches(".zip");
|
let package_name = package_name[1..].trim_end_matches(".zip");
|
||||||
let Ok(package_id) = package_name.parse::<PackageId>() else {
|
let Ok(package_id) = package_name.parse::<PackageId>() else {
|
||||||
let package_name_split = package_name.split('-').collect::<Vec<_>>();
|
let package_name_split = package_name.split('-').collect::<Vec<_>>();
|
||||||
let [api, package_name, version] = package_name_split.as_slice() else {
|
let [package_name, version, api] = package_name_split.as_slice() else {
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
"bad package filename fron download: {package_name}"
|
"bad package filename fron download: {package_name}"
|
||||||
));
|
));
|
||||||
|
@ -192,16 +192,16 @@ impl State {
|
|||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
// save the zip file itself in VFS for sharing with other nodes
|
//// save the zip file itself in VFS for sharing with other nodes
|
||||||
// call it <package_id>.zip
|
//// call it <package_id>.zip
|
||||||
let zip_path = format!("{}/api.zip", drive_name);
|
//let zip_path = format!("{}/api.zip", drive_name);
|
||||||
Request::to(("our", "vfs", "distro", "sys"))
|
//Request::to(("our", "vfs", "distro", "sys"))
|
||||||
.body(serde_json::to_vec(&vfs::VfsRequest {
|
// .body(serde_json::to_vec(&vfs::VfsRequest {
|
||||||
path: zip_path,
|
// path: zip_path,
|
||||||
action: vfs::VfsAction::Write,
|
// action: vfs::VfsAction::Write,
|
||||||
})?)
|
// })?)
|
||||||
.blob(blob)
|
// .blob(blob)
|
||||||
.send_and_await_response(5)??;
|
// .send_and_await_response(5)??;
|
||||||
}
|
}
|
||||||
self.downloaded_apis.insert(package_id.to_owned());
|
self.downloaded_apis.insert(package_id.to_owned());
|
||||||
crate::set_state(&bincode::serialize(self)?);
|
crate::set_state(&bincode::serialize(self)?);
|
||||||
|
Loading…
Reference in New Issue
Block a user