Skip to content

Commit

Permalink
Using Cached Libary to store the data in a cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustix69 committed Dec 11, 2024
1 parent 0264e49 commit aa559f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rust-version = "1.82"

[workspace.dependencies]
anyhow = "1.0.93"
cached = "0.36.0"
aquamarine = "0.6.0"
assert-json-diff = "2.0.2"
assert_matches = "1.5.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk-indexeddb/src/crypto_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use tokio::sync::Mutex;
use tracing::{debug, warn};
use wasm_bindgen::JsValue;
use web_sys::IdbKeyRange;

use cached::proc_macro::cached;
use self::indexeddb_serializer::MaybeEncrypted;
use crate::crypto_store::{
indexeddb_serializer::IndexeddbSerializer, migrations::open_and_upgrade_db,
Expand Down Expand Up @@ -1313,7 +1313,7 @@ impl_crypto_store! {
Ok(None)
}
}

#[cached(size = 100)]
async fn get_room_settings(&self, room_id: &RoomId) -> Result<Option<RoomSettings>> {
let key = self.serializer.encode_key(keys::ROOM_SETTINGS, room_id);
self
Expand Down

0 comments on commit aa559f3

Please sign in to comment.