Download codex-rs/app-server-daemon/src/thread_recovery.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-daemon/src/thread_recovery.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/app-server-daemon/src/thread_recovery.rs
-
curl -L -o thread_recovery.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-daemon/src/thread_recovery.rs
450 Bytes
| //! Removes stale snapshots before planned daemon replacements. | |
| use std::io::ErrorKind; | |
| use anyhow::Context; | |
| use anyhow::Result; | |
| use crate::Daemon; | |
| pub(crate) fn discard_pending(daemon: &Daemon) -> Result<()> { | |
| match std::fs::remove_file(daemon.recovery_file()?) { | |
| Ok(()) => Ok(()), | |
| Err(err) if err.kind() == ErrorKind::NotFound => Ok(()), | |
| Err(err) => Err(err).context("failed to clear daemon recovery file"), | |
| } | |
| } | |