Fix lockfile
continuous-integration/drone/pr Build was killed Details

This commit is contained in:
notplants 2022-05-20 16:25:18 +02:00
parent 6434471599
commit 543470b949
1 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,10 @@ pub fn save_peach_config_to_disc(
peach_config: HashMap<String, String>,
) -> Result<HashMap<String, String>, PeachError> {
// use a file lock to avoid race conditions while saving config
let mut lock = LockFile::open(&*LOCK_FILE_PATH)?;
let mut lock = LockFile::open(&*LOCK_FILE_PATH).map_err(|source| PeachError::Read {
source,
path: LOCK_FILE_PATH.to_string(),
})?;
lock.lock()?;
// first convert Hashmap to BTreeMap (so that keys are saved in deterministic alphabetical order)