2015-09-15 update 1 fix a bug that cause program not work when it running for at least one week
This commit is contained in:
@@ -377,7 +377,16 @@ namespace ModBus.Net
|
||||
}
|
||||
foreach (var machine in saveMachines)
|
||||
{
|
||||
await RunTask(machine);
|
||||
try
|
||||
{
|
||||
CancellationTokenSource cts = new CancellationTokenSource();
|
||||
cts.CancelAfter(TimeSpan.FromSeconds(30));
|
||||
await RunTask(machine).WithCancellation(cts.Token);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user