diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-08-17 12:19:08 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-08-17 12:19:08 +0200 |
commit | e2b1f02953687d0504876d35d0f4b68223e7931e (patch) | |
tree | 22fb8ae84183d1102d79d6824f2a756ffb2f49df /src/db | |
parent | 2d4945938be440411e43c3440a368df0f70e5810 (diff) |
Revert "Add spinner for establishing database connection"
This reverts commit ab04d88ae84c33f3577870c10378f0166adf27bc.
Having a progress bar for establishing the database connection was just too much
noise visually.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/connection.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/db/connection.rs b/src/db/connection.rs index 76d38c1..cf9a0c0 100644 --- a/src/db/connection.rs +++ b/src/db/connection.rs @@ -19,7 +19,6 @@ use getset::Getters; use log::debug; use crate::config::Configuration; -use crate::util::progress::ProgressBars; #[derive(Getters)] pub struct DbConnectionConfig<'a> { @@ -79,7 +78,7 @@ impl<'a> DbConnectionConfig<'a> { }) } - pub fn establish_connection(self, progressbars: &ProgressBars) -> Result<PgConnection> { + pub fn establish_connection(self) -> Result<PgConnection> { debug!("Trying to connect to database: {:?}", self); let database_uri: String = format!( "postgres://{user}:{password}@{host}:{port}/{name}?connect_timeout={timeout}", @@ -90,17 +89,7 @@ impl<'a> DbConnectionConfig<'a> { name = self.database_name, timeout = self.database_connection_timeout, ); - - let bar = progressbars.spinner(); - bar.set_message("Establishing database connection"); - - let conn = PgConnection::establish(&database_uri).map_err(Error::from); - if conn.is_err() { - bar.finish_with_message("Connection could not be established"); - } else { - bar.finish_with_message("Connection established"); - } - conn + PgConnection::establish(&database_uri).map_err(Error::from) } } |