File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -55,20 +55,25 @@ CancellationToken cancellationToken
5555 }
5656 }
5757
58- internal static async Task ClearPool ( string connectionString )
58+ internal static Task ClearPool ( string connectionString )
5959 {
6060 if ( Pools . TryRemove ( connectionString , out var sessionPool ) )
6161 {
62- await SemaphoreSlim . WaitAsync ( ) ;
63- try
62+ _ = Task . Run ( async ( ) =>
6463 {
65- await sessionPool . DisposeAsync ( ) ;
66- }
67- finally
68- {
69- SemaphoreSlim . Release ( ) ;
70- }
64+ await SemaphoreSlim . WaitAsync ( ) . ConfigureAwait ( false ) ;
65+ try
66+ {
67+ await sessionPool . DisposeAsync ( ) . ConfigureAwait ( false ) ;
68+ }
69+ finally
70+ {
71+ SemaphoreSlim . Release ( ) ;
72+ }
73+ } ) ;
7174 }
75+
76+ return Task . CompletedTask ;
7277 }
7378
7479 internal static async Task ClearAllPools ( )
You can’t perform that action at this time.
0 commit comments