Skip to content

Commit d08a99b

Browse files
committed
fixup! refactor(indexeddb): add type to represent time-based lock on event cache
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent 22ef568 commit d08a99b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl_event_cache_store! {
144144
self.transaction(&[Lease::OBJECT_STORE], IdbTransactionMode::Readwrite)?;
145145

146146
if let Some(lease) = transaction.get_lease_by_id(key).await? {
147-
if lease.holder != holder && !lease.expired_at(now) {
147+
if lease.holder != holder && !lease.has_expired(now) {
148148
return Ok(false);
149149
}
150150
}

crates/matrix-sdk-indexeddb/src/event_cache_store/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct Lease {
3232

3333
impl Lease {
3434
/// Determines whether the lease is expired at a given time `t`
35-
pub fn expired_at(&self, t: Duration) -> bool {
35+
pub fn has_expired(&self, t: Duration) -> bool {
3636
self.expiration < t
3737
}
3838
}

0 commit comments

Comments
 (0)