fix review

This commit is contained in:
rustdesk
2026-05-13 18:43:36 +08:00
parent 2643f00216
commit 2685a25e51
2 changed files with 14 additions and 4 deletions

View File

@@ -679,10 +679,20 @@ pub fn core_main() -> Option<Vec<String>> {
"OK" => {
if let Some(ref new_id) = new_id {
if *new_id != local_id {
let _ = crate::ipc::set_config("id", new_id.clone());
if let Err(err) =
crate::ipc::set_config("id", new_id.clone())
{
println!(
"Failed to persist deployed id locally: {}",
err
);
std::process::exit(1);
}
}
}
let _ = crate::ipc::notify_deployed();
if let Err(err) = crate::ipc::notify_deployed() {
log::warn!("Failed to notify deployed state: {}", err);
}
println!("Device deployed.");
}
"NOT_ENABLED" => {

View File

@@ -302,7 +302,7 @@ impl RendezvousMediator {
}
Ok(register_pk_response::Result::NOT_DEPLOYED) => {
if !NEEDS_DEPLOY.load(Ordering::SeqCst) {
log::warn!("Server requires deployment. Run `rustdesk --deploy <api_token>` on this device.");
log::warn!("Server requires deployment. Run `rustdesk --deploy --token <api_token>` on this device.");
}
NEEDS_DEPLOY.store(true, Ordering::SeqCst);
// Clear key_confirmed so the UI reflects the truth: this device is
@@ -699,7 +699,7 @@ impl RendezvousMediator {
// Throttle register_pk when the device is awaiting deployment: server
// already told us we're not in its db; sending more often than every
// DEPLOY_RETRY_INTERVAL ms is wasted traffic until the operator runs
// `rustdesk --deploy`.
// `rustdesk --deploy --token <api_token>`.
if NEEDS_DEPLOY.load(Ordering::SeqCst) {
let mut last = LAST_NOT_DEPLOYED_REGISTER.lock().await;
if let Some(t) = *last {