Skip to content

Commit

Permalink
fix redis cache feature
Browse files Browse the repository at this point in the history
  • Loading branch information
wagpa committed Oct 20, 2024
1 parent 36c35ea commit e0ae95c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/cache/level/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl RedisCache {
)]
async fn get_uuid(&self, key: &str) -> Option<Entry<UuidData>> {
let key = key!("uuid", key.to_lowercase());
self.get(key)
self.get(key).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -105,7 +105,7 @@ impl RedisCache {
)]
async fn set_uuid(&self, key: &str, entry: Entry<UuidData>) {
let key = key!("uuid", key.to_lowercase());
self.set(key, entry, &self.settings.entries.uuid.ttl)
self.set(key, entry, &self.settings.entries.uuid.ttl).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -116,7 +116,7 @@ impl RedisCache {
)]
async fn get_profile(&self, key: &Uuid) -> Option<Entry<ProfileData>> {
let key = key!("profile", key.simple());
self.get(key)
self.get(key).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -139,7 +139,7 @@ impl RedisCache {
)]
async fn get_skin(&self, key: &Uuid) -> Option<Entry<SkinData>> {
let key = key!("skin", key.simple());
self.get(key)
self.get(key).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -150,7 +150,7 @@ impl RedisCache {
)]
async fn set_skin(&self, key: &Uuid, entry: Entry<SkinData>) {
let key = key!("skin", key.simple());
self.set(key, entry, &self.settings.entries.skin.ttl)
self.set(key, entry, &self.settings.entries.skin.ttl).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -161,7 +161,7 @@ impl RedisCache {
)]
async fn get_cape(&self, key: &Uuid) -> Option<Entry<CapeData>> {
let key = key!("cape", key.simple());
self.get(key)
self.get(key).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -172,7 +172,7 @@ impl RedisCache {
)]
async fn set_cape(&self, key: &Uuid, entry: Entry<CapeData>) {
let key = key!("cape", key.simple());
self.set(key, entry, &self.settings.entries.cape.ttl)
self.set(key, entry, &self.settings.entries.cape.ttl).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -183,7 +183,7 @@ impl RedisCache {
)]
async fn get_head(&self, key: &(Uuid, bool)) -> Option<Entry<HeadData>> {
let key = key!("head", key.0.simple(), key.1);
self.get(key)
self.get(key).await
}

#[tracing::instrument(skip(self))]
Expand All @@ -194,7 +194,7 @@ impl RedisCache {
)]
async fn set_head(&self, key: &(Uuid, bool), entry: Entry<HeadData>) {
let key = key!("head", key.0.simple(), key.1);
self.set(key, entry, &self.settings.entries.head.ttl)
self.set(key, entry, &self.settings.entries.head.ttl).await
}
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//! See [settings] for a description on how to create the application configuration.
use crate::cache::level::moka::MokaCache;
#[cfg(not(feature = "redis"))]
use crate::cache::level::no::NoCache;
#[cfg(feature = "redis")]
use crate::cache::level::redis::RedisCache;
Expand Down

0 comments on commit e0ae95c

Please sign in to comment.