修复output计数
This commit is contained in:
parent
e0df7ff4e9
commit
08e0444055
@ -40,7 +40,6 @@ public class OutputService : IOutputService
|
|||||||
public async Task ExecuteAsync(CancellationToken cancellationToken)
|
public async Task ExecuteAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("***** Mysql output service started *****");
|
_logger.LogInformation("***** Mysql output service started *****");
|
||||||
var count = 0;
|
|
||||||
_taskManager.CreateTasks(async () =>
|
_taskManager.CreateTasks(async () =>
|
||||||
{
|
{
|
||||||
var records = new List<DataRecord>();
|
var records = new List<DataRecord>();
|
||||||
@ -48,12 +47,10 @@ public class OutputService : IOutputService
|
|||||||
{
|
{
|
||||||
if (!_consumerQueue.TryDequeue(out var record)) continue;
|
if (!_consumerQueue.TryDequeue(out var record)) continue;
|
||||||
records.Add(record);
|
records.Add(record);
|
||||||
count++;
|
|
||||||
//_logger.LogInformation(@"*****OutputCount: {count} *****",count);
|
//_logger.LogInformation(@"*****OutputCount: {count} *****",count);
|
||||||
if (records.Count >= _outputOptions.Value.FlushCount)
|
if (records.Count >= _outputOptions.Value.FlushCount)
|
||||||
{
|
{
|
||||||
await FlushAsync(records);
|
await FlushAsync(records);
|
||||||
_context.AddOutput(count);
|
|
||||||
records.Clear();
|
records.Clear();
|
||||||
}
|
}
|
||||||
if (_context.GetExceptions().Count>0)
|
if (_context.GetExceptions().Count>0)
|
||||||
|
Loading…
Reference in New Issue
Block a user