File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed
Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ impl RedisPool {
128128 Ok ( ( ) )
129129 }
130130
131+ #[ tracing:: instrument( skip( self ) ) ]
131132 pub async fn connect ( & self ) -> Result < RedisConnection , DatabaseError > {
132133 Ok ( RedisConnection {
133134 connection : self . pool . get ( ) . await ?,
Original file line number Diff line number Diff line change @@ -270,22 +270,6 @@ async fn app() -> std::io::Result<()> {
270270 . config ( utoipa_swagger_ui:: Config :: default ( ) . try_it_out_enabled ( true ) )
271271 . url ( "/docs/openapi.json" , ApiDoc :: openapi ( ) . merge_from ( api) ) )
272272 . into_app ( )
273- . configure ( |cfg| {
274- cfg. route ( "/testing-error-1" , actix_web:: web:: get ( ) . to ( || async {
275- async {
276- tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) . await ;
277- } . instrument ( tracing:: info_span!( "doing a DB op" ) ) . await ;
278-
279- async {
280- tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 250 ) ) . await ;
281- } . instrument ( tracing:: info_span!( "doing a redis op" ) ) . await ;
282-
283- let err = sqlx:: Error :: BeginFailed ;
284- let err = eyre:: eyre!( err) . wrap_err ( "failed to begin transaction" ) ;
285- let err = eyre:: eyre!( err) . wrap_err ( "(testing) trying to get a span to appear 2" ) ;
286- Err :: < ( ) , _ > ( labrinth:: routes:: ApiError :: Internal ( err) )
287- } ) ) ;
288- } )
289273 . configure ( |cfg| app_config ( cfg, labrinth_config. clone ( ) ) )
290274 } )
291275 . bind ( dotenvy:: var ( "BIND_ADDR" ) . unwrap ( ) ) ?
You can’t perform that action at this time.
0 commit comments