difftreelog
feat remove lock
in: trunk
Building is locked on nix store anyway
1 file changed
src/db/db.rsdiffbeforeafterboth15struct DbInternal {15struct DbInternal {16 root: PathBuf,16 root: PathBuf,17 locked_paths: HashSet<PathBuf>,17 locked_paths: HashSet<PathBuf>,18 _lockfile: lockfile::Lockfile,19}18}201921pub trait DbData: DeserializeOwned + Serialize + Default {20pub trait DbData: DeserializeOwned + Serialize + Default {32 pub fn new(root: impl AsRef<Path>) -> Result<Self> {31 pub fn new(root: impl AsRef<Path>) -> Result<Self> {33 let root: &Path = root.as_ref();32 let root: &Path = root.as_ref();34 std::fs::create_dir_all(&root).context("db root")?;33 std::fs::create_dir_all(&root).context("db root")?;35 let mut lockfile = root.to_owned();36 lockfile.push(".lock");37 let lockfile = lockfile::Lockfile::create(lockfile).context("db lock")?;38 Ok(Db(Arc::new(Mutex::new(DbInternal {34 Ok(Db(Arc::new(Mutex::new(DbInternal {39 root: root.to_owned(),35 root: root.to_owned(),40 locked_paths: HashSet::new(),36 locked_paths: HashSet::new(),41 _lockfile: lockfile,42 }))))37 }))))43 }38 }4439