Skip to content

Commit

Permalink
Add RwLock
Browse files Browse the repository at this point in the history
  • Loading branch information
RealHinome authored Aug 24, 2024
1 parent eb411d5 commit 5f056ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphql/api/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ use mcq::QuestionQuery;
use news::NewsQuery;
use search::Search;
use std::sync::Arc;
use tokio::sync::RwLock;

pub type Date = DateTime<Utc>;

/// Define the context for the GraphQL schema.
#[derive(Clone, Debug)]
pub struct Context {
/// [`search::Search`] meilisearch client.
pub meilisearch: Arc<Search>,
pub meilisearch: Arc<RwLock<Search>>,
/// Custom [`Ranker`] supporting multiple sources.
pub ranker: Ranker,
}
Expand Down

0 comments on commit 5f056ce

Please sign in to comment.