@@ -47,7 +47,7 @@ use tokio::{
47
47
fs,
48
48
sync:: { Mutex , OwnedMutexGuard } ,
49
49
} ;
50
- use tracing:: { debug, error, trace} ;
50
+ use tracing:: { debug, error, instrument , trace} ;
51
51
52
52
use crate :: {
53
53
error:: { Error , Result } ,
@@ -173,9 +173,14 @@ impl SqliteEventCacheStore {
173
173
}
174
174
175
175
// Acquire a connection for executing read operations.
176
+ #[ instrument( skip_all) ]
176
177
async fn read ( & self ) -> Result < SqliteAsyncConn > {
178
+ trace ! ( "Taking a `read` connection" ) ;
179
+
177
180
let connection = self . pool . get ( ) . await ?;
178
181
182
+ trace ! ( "`read` connection taken" ) ;
183
+
179
184
// Per https://www.sqlite.org/foreignkeys.html#fk_enable, foreign key
180
185
// support must be enabled on a per-connection basis. Execute it every
181
186
// time we try to get a connection, since we can't guarantee a previous
@@ -186,9 +191,14 @@ impl SqliteEventCacheStore {
186
191
}
187
192
188
193
// Acquire a connection for executing write operations.
194
+ #[ instrument( skip_all) ]
189
195
async fn write ( & self ) -> Result < OwnedMutexGuard < SqliteAsyncConn > > {
196
+ trace ! ( "Taking a `write` connection" ) ;
197
+
190
198
let connection = self . write_connection . clone ( ) . lock_owned ( ) . await ;
191
199
200
+ trace ! ( "`write` connection taken" ) ;
201
+
192
202
// Per https://www.sqlite.org/foreignkeys.html#fk_enable, foreign key
193
203
// support must be enabled on a per-connection basis. Execute it every
194
204
// time we try to get a connection, since we can't guarantee a previous
0 commit comments