Pārlūkot izejas kodu

Fixed exception thrown when terminate the program with Ctrl+C. (#130)

undefined
Savorboard pirms 6 gadiem
vecāks
revīzija
cd3a595ea6
2 mainītis faili ar 11 papildinājumiem un 5 dzēšanām
  1. +1
    -0
      CAP.sln
  2. +10
    -5
      src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs

+ 1
- 0
CAP.sln Parādīt failu

@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CHANGELOG.md = CHANGELOG.md
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
ConfigureMSDTC.ps1 = ConfigureMSDTC.ps1
.github\ISSUE_TEMPLATE = .github\ISSUE_TEMPLATE
LICENSE.txt = LICENSE.txt
README.md = README.md
README.zh-cn.md = README.zh-cn.md


+ 10
- 5
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs Parādīt failu

@@ -57,13 +57,14 @@ namespace DotNetCore.CAP.Processor
return;
}

_disposed = true;

_logger.ServerShuttingDown();
_cts.Cancel();
try
{
_compositeTask.Wait((int) TimeSpan.FromSeconds(10).TotalMilliseconds);
_disposed = true;

_logger.ServerShuttingDown();
_cts.Cancel();

_compositeTask?.Wait((int)TimeSpan.FromSeconds(10).TotalMilliseconds);
}
catch (AggregateException ex)
{
@@ -73,6 +74,10 @@ namespace DotNetCore.CAP.Processor
_logger.ExpectedOperationCanceledException(innerEx);
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, "An exception was occured when disposing...");
}
}

private IProcessor InfiniteRetry(IProcessor inner)


Notiek ielāde…
Atcelt
Saglabāt