Skip to content

Commit

Permalink
update whoami::hostname to whoami::fallible::hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Virv12 committed Apr 16, 2024
1 parent aa476ed commit 9d7f19c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,13 @@ impl RuntimeContext {
let (tx, rx, local_executor) = if let Some(evaluate_on) = &opt.evaluate_on {
let (tx, rx) = connect_to_remote_server(evaluate_on, 27182)
.context("Cannot connect to the remote server")?;
let name = opt
.name
.clone()
.unwrap_or_else(|| format!("{}@{}", whoami::username(), whoami::hostname()));
let name = opt.name.clone().unwrap_or_else(|| {
format!(
"{}@{}",
whoami::username(),
whoami::fallible::hostname().unwrap()
)
});
tx.send(RemoteEntityMessage::Welcome {
name,
version: VERSION.into(),
Expand Down
10 changes: 7 additions & 3 deletions src/tools/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ pub fn main_worker(opt: WorkerOpt) -> Result<(), Error> {
);
let sandbox_path = store_path.join("sandboxes");

let name = opt
.name
.unwrap_or_else(|| format!("{}@{}", whoami::username(), whoami::hostname()));
let name = opt.name.unwrap_or_else(|| {
format!(
"{}@{}",
whoami::username(),
whoami::fallible::hostname().unwrap()
)
});
let (executor_tx, executor_rx) = connect_to_remote_server(&opt.server_addr, 27183)
.context("Failed to connect to the server")?;
executor_tx
Expand Down

0 comments on commit 9d7f19c

Please sign in to comment.