This commit is contained in:
qianhao.xu
2024-11-08 10:17:58 +08:00
parent b89a44af7c
commit 719253c848
3 changed files with 4 additions and 3 deletions

View File

@@ -74,8 +74,8 @@ namespace DOAN.ServiceCore
await DbScoped.SugarScope.CopyNew().Insertable(storagelocation).ExecuteCommandAsync();
await Task.Delay(3000, stoppingToken);
Console.WriteLine("永驻线程正在读取plc值 ");
await Task.Delay(5000, stoppingToken);
Console.WriteLine("永驻线程正在读取plc值 "+ result);
index++;
if (index > 16)

View File

@@ -77,6 +77,7 @@ namespace DOAN.ServiceCore
public void Dispose()
{
PLCTool.ConnectClose();
_cancellationTokenSource.Cancel();
_executingTask.Wait();
_cancellationTokenSource.Dispose();