优化代码

This commit is contained in:
ChenYi 2025-05-12 11:20:50 +08:00
parent e35172d69f
commit 80b8942d9d

View File

@ -64,7 +64,7 @@ namespace JiShe.CollectBus.DataChannels
ChannelReader<ValueTuple<string, List<MeterReadingTelemetryPacketInfo>>> telemetryPacketInfoReader)
{
const int BatchSize = 100000;
const int EmptyWaitMilliseconds = 200;
const int EmptyWaitMilliseconds = 50;
var timeout = TimeSpan.FromSeconds(5);
var timer = Stopwatch.StartNew();
long timeoutMilliseconds = 0;
@ -83,7 +83,7 @@ namespace JiShe.CollectBus.DataChannels
_logger.LogError($"{nameof(ScheduledMeterTaskReadingAsync)} 通道处理数据耗时{timeoutMilliseconds}毫秒");
}
timeoutMilliseconds = 0;
//无消息时短等待1
//无消息时短等待50毫
await Task.Delay(EmptyWaitMilliseconds);
continue;
}