From 5c340dd71a5c4d692e696865516602cf0e935424 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Wed, 25 Oct 2023 22:24:56 -0700 Subject: [PATCH] fix: kill db settings defaults and move the chatty error! log to trace SYNC-3976 --- autoconnect/autoconnect-ws/src/error.rs | 2 +- autoconnect/autoconnect-ws/src/handler.rs | 2 +- autopush-common/src/db/bigtable/mod.rs | 20 -------------------- autopush-common/src/db/dynamodb/mod.rs | 9 --------- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/autoconnect/autoconnect-ws/src/error.rs b/autoconnect/autoconnect-ws/src/error.rs index 2d8b6960c..5d656c444 100644 --- a/autoconnect/autoconnect-ws/src/error.rs +++ b/autoconnect/autoconnect-ws/src/error.rs @@ -52,7 +52,7 @@ impl WSError { self.kind.as_ref() } - /// Emit an event for this Error to Sentry if set to + /// Emit an event for this Error to Sentry pub fn capture_sentry_event(&self, client: Option) { if !self.is_sentry_event() { return; diff --git a/autoconnect/autoconnect-ws/src/handler.rs b/autoconnect/autoconnect-ws/src/handler.rs index 3b701b8b1..3bce5706d 100644 --- a/autoconnect/autoconnect-ws/src/handler.rs +++ b/autoconnect/autoconnect-ws/src/handler.rs @@ -29,7 +29,7 @@ pub fn spawn_webpush_ws( let close_reason = webpush_ws(client, &mut session, msg_stream) .await .unwrap_or_else(|e| { - error!("spawn_webpush_ws: Error: {}", e); + trace!("spawn_webpush_ws: Error: {}", e); Some(CloseReason { code: e.close_code(), description: Some(e.close_description().to_owned()), diff --git a/autopush-common/src/db/bigtable/mod.rs b/autopush-common/src/db/bigtable/mod.rs index c2ed5a288..35d28d393 100644 --- a/autopush-common/src/db/bigtable/mod.rs +++ b/autopush-common/src/db/bigtable/mod.rs @@ -30,7 +30,6 @@ use crate::db::error::DbError; /// The settings for accessing the BigTable contents. #[derive(Clone, Debug, Deserialize)] -#[serde(default)] pub struct BigTableDbSettings { /// The Table name matches the GRPC template for table paths. /// e.g. `projects/{projectid}/instances/{instanceid}/tables/{tablename}` @@ -48,25 +47,6 @@ pub struct BigTableDbSettings { pub message_topic_family: String, } -/// NOTE: autopush will not autogenerate these families. They should -/// be created when the table is first provisioned. See -/// [BigTable schema](https://cloud.google.com/bigtable/docs/schema-design) -/// -/// BE SURE TO CONFIRM the names of the families. These are not checked on -/// initialization, but will throw errors if not present or incorrectly -/// spelled. -/// -impl Default for BigTableDbSettings { - fn default() -> Self { - Self { - table_name: "autopush".to_owned(), - router_family: "router".to_owned(), - message_family: "message".to_owned(), - message_topic_family: "message_topic".to_owned(), - } - } -} - impl TryFrom<&str> for BigTableDbSettings { type Error = DbError; fn try_from(setting_string: &str) -> Result { diff --git a/autopush-common/src/db/dynamodb/mod.rs b/autopush-common/src/db/dynamodb/mod.rs index ac9a839ab..6965862bc 100644 --- a/autopush-common/src/db/dynamodb/mod.rs +++ b/autopush-common/src/db/dynamodb/mod.rs @@ -42,15 +42,6 @@ pub struct DynamoDbSettings { pub message_table: String, } -impl Default for DynamoDbSettings { - fn default() -> Self { - Self { - router_table: "router".to_string(), - message_table: "message".to_string(), - } - } -} - impl TryFrom<&str> for DynamoDbSettings { type Error = DbError; fn try_from(setting_string: &str) -> Result {