Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dekkku committed Sep 12, 2024
1 parent 3551420 commit 6dcd048
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions projects/dekkku/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ impl Post {
) -> std::result::Result<Option<User>, async_graphql::Error> {
let cache = ctx.data_unchecked::<Arc<Cache>>();
if cache.should_fetch_users(&self.user_id) {
let user = cache
.users
.get(&self.user_id)
.map(|ref_multi| ref_multi.clone());
let user = cache.users.read().unwrap().get(&self.user_id).cloned();
Ok(user)
} else {
let loader = ctx.data_unchecked::<DataLoader<UserLoader>>();
Expand Down

0 comments on commit 6dcd048

Please sign in to comment.