fix(instance): release locks explicitly across all instance operations
This commit is contained in:
1 parent
3479a05e63
commit
7cbfe9cd0d
4 files changed
+31
-14
No files matched your search
@@ -14,7 +14,7 @@ const MANIFEST_VERSION: u32 = 1;
|
||||
|
||||
pub(crate) struct ContentLock {
|
||||
file: File,
|
||||
instance_lock: Option<File>,
|
||||
_instance_lock: Option<crate::instance::runtime::InstanceLock>,
|
||||
path: PathBuf,
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ impl ContentLock {
|
||||
}
|
||||
Ok(Self {
|
||||
file,
|
||||
instance_lock,
|
||||
_instance_lock: instance_lock,
|
||||
path: path.to_owned(),
|
||||
})
|
||||
}
|
||||
@@ -105,14 +105,6 @@ impl Drop for ContentLock {
|
||||
self.path.display()
|
||||
);
|
||||
}
|
||||
if let Some(file) = &self.instance_lock
|
||||
&& let Err(error) = file.unlock()
|
||||
{
|
||||
tracing::warn!(
|
||||
"Could not release instance lock for '{}': {error}",
|
||||
self.path.display()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user