Skip to content

Commit 52850be

Browse files
optimize if
1 parent b8b8fce commit 52850be

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Ydb.Sdk/src/Ado/Session/PoolingSessionSource.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ YdbConnectionStringBuilder settings
4848

4949
public ValueTask<ISession> OpenSession(CancellationToken cancellationToken = default)
5050
{
51-
if (IsDisposed)
52-
throw new YdbException("The session source has been shut down.");
53-
5451
cancellationToken.ThrowIfCancellationRequested();
5552

5653
return TryGetIdleSession(out var session)

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/YdbConnectionTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public async Task BulkUpsertImporter_MultipleImporters_Parallel()
412412
var table1 = $"BulkImporter_{Guid.NewGuid():N}_1";
413413
var table2 = $"BulkImporter_{Guid.NewGuid():N}_2";
414414

415-
await using var conn = await CreateOpenConnectionAsync();
415+
var conn = await CreateOpenConnectionAsync();
416416
try
417417
{
418418
foreach (var table in new[] { table1, table2 })
@@ -467,6 +467,8 @@ await Task.WhenAll(
467467
dropCmd.CommandText = $"DROP TABLE {table}";
468468
await dropCmd.ExecuteNonQueryAsync();
469469
}
470+
471+
await conn.DisposeAsync();
470472
}
471473
}
472474

0 commit comments

Comments
 (0)