@@ -50,7 +50,7 @@ pub async fn process_spot_entries(pool: Pool, mut rx: mpsc::Receiver<NewEntry>)
50
50
#[ tracing:: instrument( skip( pool, rx) ) ]
51
51
pub async fn process_future_entries ( pool : Pool , mut rx : mpsc:: Receiver < NewFutureEntry > ) {
52
52
const BUFFER_CAPACITY : usize = 100 ;
53
- const FLUSH_TIMEOUT : Duration = Duration :: from_secs ( 30 ) ;
53
+ const FLUSH_TIMEOUT : Duration = Duration :: from_millis ( 50 ) ;
54
54
55
55
let mut buffer = Vec :: with_capacity ( BUFFER_CAPACITY ) ;
56
56
let mut flush_interval = interval ( FLUSH_TIMEOUT ) ;
@@ -129,7 +129,7 @@ pub async fn process_funding_rate_entries(pool: Pool, mut rx: mpsc::Receiver<New
129
129
}
130
130
}
131
131
132
- #[ tracing:: instrument( skip ( pool ) ) ]
132
+ #[ tracing:: instrument( skip_all , fields ( num_entries = new_entries . len ( ) ) ) ]
133
133
async fn insert_spot_entries ( pool : & Pool , new_entries : Vec < NewEntry > ) -> Result < ( ) , InfraError > {
134
134
let conn = pool. get ( ) . await . map_err ( InfraError :: DbPoolError ) ?;
135
135
let entries = conn
@@ -148,7 +148,7 @@ async fn insert_spot_entries(pool: &Pool, new_entries: Vec<NewEntry>) -> Result<
148
148
Ok ( ( ) )
149
149
}
150
150
151
- #[ tracing:: instrument( skip ( pool ) ) ]
151
+ #[ tracing:: instrument( skip_all , fields ( num_entries = new_entries . len ( ) ) ) ]
152
152
async fn insert_future_entries (
153
153
pool : & Pool ,
154
154
new_entries : Vec < NewFutureEntry > ,
@@ -189,7 +189,7 @@ async fn insert_future_entries(
189
189
Ok ( ( ) )
190
190
}
191
191
192
- #[ tracing:: instrument( skip ( pool ) ) ]
192
+ #[ tracing:: instrument( skip_all , fields ( num_entries = new_entries . len ( ) ) ) ]
193
193
async fn insert_funding_rate_entries (
194
194
pool : & Pool ,
195
195
new_entries : Vec < NewFundingRate > ,
0 commit comments