MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / reset_runtime_cache_mutable_state

Function reset_runtime_cache_mutable_state

src/pglite/base.rs:1858–1881  ·  view source on GitHub ↗
(runtime_root: &Path)

Source from the content-addressed store, hash-verified

1856}
1857
1858fn reset_runtime_cache_mutable_state(runtime_root: &Path) -> Result<()> {
1859 for relative in ["base", "tmp", "dev/shm"] {
1860 let path = runtime_root.join(relative);
1861 match fs::remove_dir_all(&path) {
1862 Ok(()) => {}
1863 Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}
1864 Err(err) => {
1865 return Err(err).with_context(|| {
1866 format!("remove mutable runtime-cache state {}", path.display())
1867 });
1868 }
1869 }
1870 }
1871 fs::create_dir_all(runtime_root.join("tmp"))
1872 .with_context(|| format!("create runtime cache tmp under {}", runtime_root.display()))?;
1873 fs::create_dir_all(runtime_root.join("dev/shm")).with_context(|| {
1874 format!(
1875 "create runtime cache shared-memory dir under {}",
1876 runtime_root.display()
1877 )
1878 })?;
1879 ensure_runtime_password_file(runtime_root)?;
1880 Ok(())
1881}
1882
1883fn ensure_runtime_password_file(runtime_root: &Path) -> Result<()> {
1884 let path = runtime_root.join("password");

Callers 1

build_runtime_cacheFunction · 0.85

Calls 2

joinMethod · 0.45

Tested by

no test coverage detected