改进模拟数据生成器,代码质量优化

This commit is contained in:
2024-12-25 15:09:16 +08:00
parent 4986c60416
commit 77a3909160
10 changed files with 102 additions and 58 deletions

View File

@@ -64,7 +64,7 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
if (_recordCache.Count == 0)
return;
var cmd = _conn.CreateCommand();
await using var cmd = _conn.CreateCommand();
cmd.CommandTimeout = 0;
try
@@ -255,11 +255,13 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
{
_conn.Close();
_conn.Dispose();
_recordCache.Clear();
}
public async ValueTask DisposeAsync()
{
await _conn.CloseAsync();
await _conn.DisposeAsync();
_recordCache.Clear();
}
}