Skip to content

Commit 2eece78

Browse files
committed
test
1 parent 43f9ade commit 2eece78

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/Ydb.Sdk/src/Ado/PoolManager.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)