From a9da1541dd8aa0a7bc964ae8116edb1765d7d4b5 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Fri, 21 Aug 2020 17:14:31 -0700 Subject: [PATCH] f kill dev comments --- src/db/spanner/manager/bb8.rs | 2 -- src/db/spanner/manager/deadpool.rs | 4 ---- src/db/spanner/pool.rs | 10 ---------- 3 files changed, 16 deletions(-) diff --git a/src/db/spanner/manager/bb8.rs b/src/db/spanner/manager/bb8.rs index 181e01548a..b154889059 100644 --- a/src/db/spanner/manager/bb8.rs +++ b/src/db/spanner/manager/bb8.rs @@ -18,7 +18,6 @@ use crate::{ settings::Settings, }; -// XXX: pub const SPANNER_ADDRESS: &str = "spanner.googleapis.com:443"; pub struct SpannerConnectionManager { @@ -132,7 +131,6 @@ impl ManageConnection } } -// XXX: pub async fn create_session( client: &SpannerClient, database_name: &str, diff --git a/src/db/spanner/manager/deadpool.rs b/src/db/spanner/manager/deadpool.rs index 0077b6705c..e75e7dd3ad 100644 --- a/src/db/spanner/manager/deadpool.rs +++ b/src/db/spanner/manager/deadpool.rs @@ -12,12 +12,8 @@ use crate::{ settings::Settings, }; -// XXX: use super::bb8::{create_session, SpannerSession, SPANNER_ADDRESS}; -// - -> SpannerSessionManager (and bb8 too) -// - bb8s doesn't need the PhantomData -// - kill the lifetimes for now or PhantomData one pub struct Manager { database_name: String, /// The gRPC environment diff --git a/src/db/spanner/pool.rs b/src/db/spanner/pool.rs index 94bcd5009f..74150e09dd 100644 --- a/src/db/spanner/pool.rs +++ b/src/db/spanner/pool.rs @@ -16,7 +16,6 @@ use super::manager::bb8::SpannerSession; use super::models::SpannerDb; use crate::error::ApiResult; -//pub(super) type Conn<'a> = PooledConnection<'a, SpannerConnectionManager>; pub(super) type Conn = deadpool::managed::Object; embed_migrations!(); @@ -49,14 +48,7 @@ impl SpannerDbPool { } pub async fn new_without_migrations(settings: &Settings, metrics: &Metrics) -> Result { - //let manager = SpannerConnectionManager::::new(settings, metrics)?; let max_size = settings.database_pool_max_size.unwrap_or(10); - /* - let builder = bb8::Pool::builder() - .max_size(max_size) - .min_idle(settings.database_pool_min_idle) - .error_sink(Box::new(LoggingErrorSink)); - */ let manager = super::manager::deadpool::Manager::new(settings, metrics)?; let config = deadpool::managed::PoolConfig::new(max_size as usize); let pool = deadpool::managed::Pool::from_config(manager, config); @@ -70,8 +62,6 @@ impl SpannerDbPool { pub async fn get_async(&self) -> Result { let conn = self.pool.get().await.map_err(|e| match e { - //bb8::RunError::User(dbe) => dbe, - //bb8::RunError::TimedOut => DbError::internal("bb8:TimedOut"), deadpool::managed::PoolError::Backend(dbe) => dbe, deadpool::managed::PoolError::Timeout(timeout_type) => { DbError::internal(&format!("deadpool Timeout: {:?}", timeout_type))