|
|
@ -30,9 +30,9 @@ public class Worker : BackgroundService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
XTrace.WriteLine("Worker running at: {0}", DateTimeOffset.Now);
|
|
|
|
XTrace.WriteLine("Worker running at: {0}", DateTimeOffset.Now);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int delay = Convert.ToInt32(_configuration.GetConnectionString("Delay"));
|
|
|
|
await Task.Delay(5000, stoppingToken);
|
|
|
|
await Task.Delay(delay, stoppingToken);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -56,6 +56,7 @@ public class Worker : BackgroundService
|
|
|
|
e.PValue = a.Content;
|
|
|
|
e.PValue = a.Content;
|
|
|
|
await dbClient.Updateable(e).UpdateColumns(x => new { x.UpdateTime, x.PValue })
|
|
|
|
await dbClient.Updateable(e).UpdateColumns(x => new { x.UpdateTime, x.PValue })
|
|
|
|
.ExecuteCommandAsync(stoppingToken);
|
|
|
|
.ExecuteCommandAsync(stoppingToken);
|
|
|
|
|
|
|
|
XTrace.WriteLine("Point:{0}, Value:{1}", e.Point, e.PValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -78,6 +79,7 @@ public class Worker : BackgroundService
|
|
|
|
CreateTime = DateTime.Now,
|
|
|
|
CreateTime = DateTime.Now,
|
|
|
|
Data = Math.Round(Convert.ToDecimal(a.Content), 2)
|
|
|
|
Data = Math.Round(Convert.ToDecimal(a.Content), 2)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
XTrace.WriteLine("Point:{0}, Value:{1}", e.Point, listd.Data);
|
|
|
|
ls.Add(listd);
|
|
|
|
ls.Add(listd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|