refactor: Minor improvements, some extra comments

This commit is contained in:
Jorge Martín
2026-02-19 11:46:03 +01:00
committed by Ivan Enderlin
parent 54e4cb2d10
commit 11f2bf0ad6
2 changed files with 5 additions and 6 deletions
@@ -82,12 +82,9 @@ impl EventCacheStoreLock {
/// Acquire a spin lock (see [`CrossProcessLock::spin_lock`]).
pub async fn lock(&self) -> Result<EventCacheStoreLockState, CrossProcessLockError> {
let lock_state =
self.cross_process_lock.spin_lock(None).await??.map(|cross_process_lock_guard| {
EventCacheStoreLockGuard { cross_process_lock_guard, store: self.store.clone() }
});
Ok(lock_state)
Ok(self.cross_process_lock.spin_lock(None).await??.map(|cross_process_lock_guard| {
EventCacheStoreLockGuard { cross_process_lock_guard, store: self.store.clone() }
}))
}
}
@@ -457,6 +457,8 @@ where
// lock in `try_lock_once` should sequentialize it all.
loop {
// If the cross-process lock config is not `MultiProcess`, this behaves as a
// no-op and we just return
let lock_result = self.try_lock_once().await?;
if lock_result.is_ok() {