mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
codex: fix rmcp pid-file race (#13593)
This commit is contained in:
@@ -24,8 +24,13 @@ async fn wait_for_pid_file(path: &Path) -> Result<u32> {
|
||||
for _ in 0..50 {
|
||||
match fs::read_to_string(path) {
|
||||
Ok(content) => {
|
||||
let pid = content
|
||||
.trim()
|
||||
let trimmed = content.trim();
|
||||
if trimmed.is_empty() {
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
continue;
|
||||
}
|
||||
|
||||
let pid = trimmed
|
||||
.parse::<u32>()
|
||||
.with_context(|| format!("failed to parse pid from {}", path.display()))?;
|
||||
return Ok(pid);
|
||||
|
||||
Reference in New Issue
Block a user