Skip to content

Commit 57d08c0

Browse files
committed
fix: remove logs
1 parent c365a96 commit 57d08c0

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

Diff for: pragma-ingestor/src/db.rs

+2-22
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use pragma_entities::{
33
Entry, FundingRate, FutureEntry, InfraError, NewEntry, NewFundingRate, NewFutureEntry,
44
};
55
use tokio::sync::mpsc;
6-
use tokio::time::{interval, Duration, Instant};
7-
use tracing::{debug, info};
6+
use tracing::debug;
87

98
#[tracing::instrument(skip(pool, rx))]
109
pub async fn process_spot_entries(pool: Pool, mut rx: mpsc::Receiver<NewEntry>) {
@@ -40,7 +39,6 @@ pub async fn process_spot_entries(pool: Pool, mut rx: mpsc::Receiver<NewEntry>)
4039
#[tracing::instrument(skip(pool, rx))]
4140
pub async fn process_future_entries(pool: Pool, mut rx: mpsc::Receiver<NewFutureEntry>) {
4241
const BUFFER_CAPACITY: usize = 100;
43-
const FLUSH_TIMEOUT: Duration = Duration::from_millis(50);
4442

4543
let mut buffer = Vec::with_capacity(BUFFER_CAPACITY);
4644

@@ -102,25 +100,13 @@ pub async fn process_funding_rate_entries(pool: Pool, mut rx: mpsc::Receiver<New
102100

103101
#[tracing::instrument(skip_all, fields(num_entries = new_entries.len()))]
104102
async fn insert_spot_entries(pool: &Pool, new_entries: Vec<NewEntry>) -> Result<(), InfraError> {
105-
let start = Instant::now();
106-
let len = new_entries.len();
107103
let conn = pool.get().await.map_err(InfraError::DbPoolError)?;
108104
let entries = conn
109105
.interact(move |conn| Entry::create_many(conn, new_entries))
110106
.await
111107
.map_err(InfraError::DbInteractionError)?
112108
.map_err(InfraError::DbResultError)?;
113109

114-
let duration = start.elapsed();
115-
info!("insert_spot_entries took {:?} for {} entries", duration, len);
116-
117-
for entry in &entries {
118-
debug!(
119-
"new spot entry created {} - {}({}) - {}",
120-
entry.publisher, entry.pair_id, entry.price, entry.source
121-
);
122-
}
123-
124110
Ok(())
125111
}
126112

@@ -151,17 +137,11 @@ async fn insert_future_entries(
151137
.count()
152138
);
153139

154-
let entries = conn
140+
conn
155141
.interact(move |conn| FutureEntry::create_many(conn, new_entries))
156142
.await
157143
.map_err(InfraError::DbInteractionError)?
158144
.map_err(InfraError::DbResultError)?;
159-
for entry in &entries {
160-
debug!(
161-
"new perp entry created {} - {}({}) - {}",
162-
entry.publisher, entry.pair_id, entry.price, entry.source
163-
);
164-
}
165145
Ok(())
166146
}
167147

0 commit comments

Comments
 (0)