改进模拟数据生成器,代码质量优化
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user