Skip to content

Commit

Permalink
cleanup logs
Browse files Browse the repository at this point in the history
  • Loading branch information
1xstj committed Oct 24, 2023
1 parent 4d073ed commit 7bb9c2d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dkg-gadget/src/db/sql_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl SqlBackend {
fn connect_options(config: &BackendConfig) -> Result<SqliteConnectOptions, Error> {
match config {
BackendConfig::Sqlite(config) => {
log::info!(target: "frontier-sql", "📑 Connection configuration: {config:?}");
log::info!(target: "dkg-gadget", "📑 Connection configuration: {config:?}");
let config = sqlx::sqlite::SqliteConnectOptions::from_str(config.path)?
.create_if_missing(config.create_if_missing)
// https://www.sqlite.org/pragma.html#pragma_busy_timeout
Expand Down Expand Up @@ -138,10 +138,7 @@ impl SqlBackend {
}

async fn get_local_key(&self, session_id: SessionId) -> Result<Option<LocalKeyType>, DKGError> {
log::info!(
"{}",
format!("Offchain Storage : Fetching local keys for session {session_id:?}")
);
log::info!("{}", format!("SQL Storage : Fetching local keys for session {session_id:?}"));
let session_id: i64 = session_id as i64;
match sqlx::query("SELECT local_key FROM dkg_keys WHERE session_id = ?")
.bind(session_id)
Expand Down Expand Up @@ -171,8 +168,8 @@ impl SqlBackend {
log::info!(
"{}",
format!(
"Offchain Storage : Store local keys for session {session_id:?}, Key : {local_key:?}"
)
"SQL Storage : Store local keys for session {session_id:?}, Key : {local_key:?}"
)
);
let session_id: i64 = session_id as i64;
let mut tx = self.pool().begin().await.map_err(|_| DKGError::StoringLocalKeyFailed)?;
Expand All @@ -183,8 +180,6 @@ impl SqlBackend {
.execute(&mut *tx)
.await
.map_err(|_| DKGError::StoringLocalKeyFailed)?;

log::debug!(target: "frontier-sql", "[Metadata] Ready to commit");
tx.commit().await.map_err(|_| DKGError::StoringLocalKeyFailed)
}
}
Expand Down

0 comments on commit 7bb9c2d

Please sign in to comment.