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

@@ -11,7 +11,7 @@
{ {
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=GXAssembly;Port=3308", "Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=pbl_huaxiang;Port=3308",
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3PgSql = 4 "DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3PgSql = 4
"ConfigId": "0", //多租户唯一标识 "ConfigId": "0", //多租户唯一标识
"IsAutoCloseConnection": true "IsAutoCloseConnection": true

View File

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

View File

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