mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-26 23:27:14 +03:00
Merge branch 'develop' into dr/settings-page
This commit is contained in:
commit
0eea822c22
@ -25,7 +25,7 @@ zip = "0.6"
|
||||
simulation-mode = []
|
||||
|
||||
[dependencies]
|
||||
aes-gcm = "0.10.2"
|
||||
aes-gcm = "0.10.3"
|
||||
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
||||
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
||||
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4", features = ["ws"]}
|
||||
@ -76,7 +76,7 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_urlencoded = "0.7"
|
||||
sha2 = "0.10"
|
||||
snow = { version = "0.9.3", features = ["ring-resolver"] }
|
||||
snow = { version = "0.9.5", features = ["ring-resolver"] }
|
||||
static_dir = "0.2.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "1.28", features = ["fs", "macros", "rt-multi-thread", "signal", "sync"] }
|
||||
|
@ -607,7 +607,7 @@ pub async fn make_process_loop(
|
||||
};
|
||||
|
||||
// the process will run until it returns from init() or crashes
|
||||
let is_error = match bindings
|
||||
match bindings
|
||||
.call_init(&mut store, &metadata.our.to_string())
|
||||
.await
|
||||
{
|
||||
@ -618,7 +618,6 @@ pub async fn make_process_loop(
|
||||
content: format!("process {} returned without error", metadata.our.process),
|
||||
})
|
||||
.await;
|
||||
false
|
||||
}
|
||||
Err(_) => {
|
||||
let stderr = wasi_stderr.contents().into();
|
||||
@ -632,7 +631,6 @@ pub async fn make_process_loop(
|
||||
),
|
||||
})
|
||||
.await;
|
||||
true
|
||||
}
|
||||
};
|
||||
|
||||
@ -715,73 +713,61 @@ pub async fn make_process_loop(
|
||||
lazy_load_blob: None,
|
||||
})
|
||||
.await?;
|
||||
if is_error {
|
||||
let _ = send_to_terminal
|
||||
.send(t::Printout {
|
||||
verbosity: 0,
|
||||
content: format!(
|
||||
"skipping OnExit::Restart for process {} due to crash",
|
||||
metadata.our.process
|
||||
),
|
||||
})
|
||||
.await;
|
||||
} else {
|
||||
let _ = send_to_terminal
|
||||
.send(t::Printout {
|
||||
verbosity: 1,
|
||||
content: format!(
|
||||
"firing OnExit::Restart for process {}",
|
||||
metadata.our.process
|
||||
),
|
||||
})
|
||||
.await;
|
||||
send_to_loop
|
||||
.send(t::KernelMessage {
|
||||
id: rand::random(),
|
||||
source: our_kernel.clone(),
|
||||
target: our_kernel.clone(),
|
||||
rsvp: None,
|
||||
message: t::Message::Request(t::Request {
|
||||
inherit: false,
|
||||
expects_response: None,
|
||||
body: serde_json::to_vec(&t::KernelCommand::InitializeProcess {
|
||||
id: metadata.our.process.clone(),
|
||||
wasm_bytes_handle: metadata.wasm_bytes_handle,
|
||||
wit_version: Some(metadata.wit_version),
|
||||
on_exit: metadata.on_exit,
|
||||
initial_capabilities,
|
||||
public: metadata.public,
|
||||
})
|
||||
.unwrap(),
|
||||
metadata: None,
|
||||
capabilities: vec![],
|
||||
}),
|
||||
lazy_load_blob: Some(t::LazyLoadBlob {
|
||||
mime: None,
|
||||
bytes: wasm_bytes,
|
||||
}),
|
||||
})
|
||||
.await?;
|
||||
send_to_loop
|
||||
.send(t::KernelMessage {
|
||||
id: rand::random(),
|
||||
source: our_kernel.clone(),
|
||||
target: our_kernel.clone(),
|
||||
rsvp: None,
|
||||
message: t::Message::Request(t::Request {
|
||||
inherit: false,
|
||||
expects_response: None,
|
||||
body: serde_json::to_vec(&t::KernelCommand::RunProcess(
|
||||
metadata.our.process.clone(),
|
||||
))
|
||||
.unwrap(),
|
||||
metadata: None,
|
||||
capabilities: vec![],
|
||||
}),
|
||||
lazy_load_blob: None,
|
||||
})
|
||||
.await?;
|
||||
}
|
||||
let _ = send_to_terminal
|
||||
.send(t::Printout {
|
||||
verbosity: 1,
|
||||
content: format!(
|
||||
"firing OnExit::Restart for process {}",
|
||||
metadata.our.process
|
||||
),
|
||||
})
|
||||
.await;
|
||||
send_to_loop
|
||||
.send(t::KernelMessage {
|
||||
id: rand::random(),
|
||||
source: our_kernel.clone(),
|
||||
target: our_kernel.clone(),
|
||||
rsvp: None,
|
||||
message: t::Message::Request(t::Request {
|
||||
inherit: false,
|
||||
expects_response: None,
|
||||
body: serde_json::to_vec(&t::KernelCommand::InitializeProcess {
|
||||
id: metadata.our.process.clone(),
|
||||
wasm_bytes_handle: metadata.wasm_bytes_handle,
|
||||
wit_version: Some(metadata.wit_version),
|
||||
on_exit: metadata.on_exit,
|
||||
initial_capabilities,
|
||||
public: metadata.public,
|
||||
})
|
||||
.unwrap(),
|
||||
metadata: None,
|
||||
capabilities: vec![],
|
||||
}),
|
||||
lazy_load_blob: Some(t::LazyLoadBlob {
|
||||
mime: None,
|
||||
bytes: wasm_bytes,
|
||||
}),
|
||||
})
|
||||
.await?;
|
||||
send_to_loop
|
||||
.send(t::KernelMessage {
|
||||
id: rand::random(),
|
||||
source: our_kernel.clone(),
|
||||
target: our_kernel.clone(),
|
||||
rsvp: None,
|
||||
message: t::Message::Request(t::Request {
|
||||
inherit: false,
|
||||
expects_response: None,
|
||||
body: serde_json::to_vec(&t::KernelCommand::RunProcess(
|
||||
metadata.our.process.clone(),
|
||||
))
|
||||
.unwrap(),
|
||||
metadata: None,
|
||||
capabilities: vec![],
|
||||
}),
|
||||
lazy_load_blob: None,
|
||||
})
|
||||
.await?;
|
||||
}
|
||||
// if requests, fire them
|
||||
// even in death, a process can only message processes it has capabilities for
|
||||
|
Loading…
Reference in New Issue
Block a user