Merge branch 'integration/0.3.0' of github.com:Start9Labs/embassy-os into integration/0.3.0

This commit is contained in:
Matt Hill
2021-09-23 17:42:05 -06:00
2 changed files with 8 additions and 3 deletions

View File

@@ -41,9 +41,14 @@ pub struct CliContextSeed {
impl Drop for CliContextSeed {
fn drop(&mut self) {
let tmp = format!("{}.tmp", self.cookie_path.display());
let mut writer = File::create(&tmp).unwrap();
let mut writer = fd_lock_rs::FdLock::lock(
File::create(&tmp).unwrap(),
fd_lock_rs::LockType::Exclusive,
true,
)
.unwrap();
let store = self.cookie_store.lock().unwrap();
store.save_json(&mut writer).unwrap();
store.save_json(&mut *writer).unwrap();
writer.sync_all().unwrap();
std::fs::rename(tmp, &self.cookie_path).unwrap();
}

View File

@@ -193,6 +193,6 @@ pub async fn ui(
let ptr = "/ui".parse::<JsonPointer>()? + &pointer;
Ok(WithRevision {
response: (),
revision: Some(ctx.db.put(&ptr, &value, None).await?),
revision: ctx.db.put(&ptr, &value, None).await?,
})
}