File tree Expand file tree Collapse file tree 2 files changed +95
-80
lines changed Expand file tree Collapse file tree 2 files changed +95
-80
lines changed Original file line number Diff line number Diff line change @@ -351,14 +351,31 @@ impl ManageConnection for ServerPool {
351
351
self . address, self . user. name
352
352
) ;
353
353
354
- Server :: startup (
354
+ // Put a temporary process_id into the stats
355
+ // for server login.
356
+ let process_id = rand:: random :: < i32 > ( ) ;
357
+ self . stats . server_login ( process_id) ;
358
+
359
+ match Server :: startup (
355
360
& self . address ,
356
361
& self . user ,
357
362
& self . database ,
358
363
self . client_server_map . clone ( ) ,
359
364
self . stats . clone ( ) ,
360
365
)
361
366
. await
367
+ {
368
+ Ok ( conn) => {
369
+ // Remove the temporary process_id from the stats.
370
+ self . stats . server_disconnecting ( process_id) ;
371
+ Ok ( conn)
372
+ }
373
+ Err ( err) => {
374
+ // Remove the temporary process_id from the stats.
375
+ self . stats . server_disconnecting ( process_id) ;
376
+ Err ( err)
377
+ }
378
+ }
362
379
}
363
380
364
381
/// Determines if the connection is still connected to the database.
You can’t perform that action at this time.
0 commit comments