mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Merge branch 'integration/0.3.0' of github.com:Start9Labs/embassy-os into integration/0.3.0
This commit is contained in:
@@ -41,9 +41,14 @@ pub struct CliContextSeed {
|
|||||||
impl Drop for CliContextSeed {
|
impl Drop for CliContextSeed {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let tmp = format!("{}.tmp", self.cookie_path.display());
|
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();
|
let store = self.cookie_store.lock().unwrap();
|
||||||
store.save_json(&mut writer).unwrap();
|
store.save_json(&mut *writer).unwrap();
|
||||||
writer.sync_all().unwrap();
|
writer.sync_all().unwrap();
|
||||||
std::fs::rename(tmp, &self.cookie_path).unwrap();
|
std::fs::rename(tmp, &self.cookie_path).unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,6 +193,6 @@ pub async fn ui(
|
|||||||
let ptr = "/ui".parse::<JsonPointer>()? + &pointer;
|
let ptr = "/ui".parse::<JsonPointer>()? + &pointer;
|
||||||
Ok(WithRevision {
|
Ok(WithRevision {
|
||||||
response: (),
|
response: (),
|
||||||
revision: Some(ctx.db.put(&ptr, &value, None).await?),
|
revision: ctx.db.put(&ptr, &value, None).await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user