fix: macos, defunct process (#12315)
Some checks are pending
CI / ${{ matrix.job.target }} (${{ matrix.job.os }}) (map[os:ubuntu-22.04 target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Full Flutter CI / run-ci (push) Waiting to run

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-07-16 14:17:16 +08:00 committed by GitHub
parent 661be6ae36
commit e711f73451
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,11 +231,13 @@ pub async fn create_tcp_connection(
#[cfg(target_os = "macos")]
{
use std::process::Command;
Command::new("/usr/bin/caffeinate")
if let Ok(task) = Command::new("/usr/bin/caffeinate")
.arg("-u")
.arg("-t 5")
.spawn()
.ok();
{
super::CHILD_PROCESS.lock().unwrap().push(task);
}
log::info!("wake up macos");
}
Connection::start(addr, stream, id, Arc::downgrade(&server)).await;