diff --git a/common/src/db/mod.rs b/common/src/db/mod.rs index e30467bfd..b1133e4c9 100644 --- a/common/src/db/mod.rs +++ b/common/src/db/mod.rs @@ -52,15 +52,6 @@ impl AsRef for () { } } -/* -impl<'db> From<&'db DatabaseTransaction> for Transactional<'db> { - fn from(inner: &'db DatabaseTransaction) -> Self { - Self::Some(inner) - } -} - - */ - #[derive(Clone)] pub enum ConnectionOrTransaction<'db> { Connection(&'db DatabaseConnection), diff --git a/modules/graphql/src/endpoints.rs b/modules/graphql/src/endpoints.rs index a67f0edde..e60b16eeb 100644 --- a/modules/graphql/src/endpoints.rs +++ b/modules/graphql/src/endpoints.rs @@ -1,7 +1,6 @@ use actix_web::{guard, web, HttpResponse, Result}; use async_graphql::{http::GraphiQLSource, EmptyMutation, EmptySubscription, Schema}; use async_graphql_actix_web::GraphQL; -use std::sync::Arc; use trustify_common::db::Database; use trustify_module_ingestor::graph::Graph; @@ -13,10 +12,10 @@ async fn index_graphiql() -> Result { .body(GraphiQLSource::build().endpoint("/graphql").finish())) } -pub fn configure(svc: &mut web::ServiceConfig, db: Database, graph: Arc) { +pub fn configure(svc: &mut web::ServiceConfig, db: Database, graph: Graph) { let schema = Schema::build(RootQuery::default(), EmptyMutation, EmptySubscription) - .data::>(graph) - .data::>(Arc::new(db)) + .data::(graph) + .data::(db) .finish(); svc.service( diff --git a/server/src/lib.rs b/server/src/lib.rs index 0b55edcd1..10e226505 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -295,7 +295,7 @@ fn configure( auth: Option>, ui: Arc, ) { - let graph = Arc::new(Graph::new(db.clone())); + let graph = Graph::new(db.clone()); // set global request limits @@ -347,7 +347,7 @@ fn configure( trustify_module_graphql::endpoints::configure_graphiql(svc); }), ); - svc.app_data(web::Data::from(graph)) + svc.app_data(graph) .service(web::scope("/api").wrap(new_auth(auth)).configure(|svc| { trustify_module_importer::endpoints::configure(svc, db.clone());