Skip to content

Commit

Permalink
Avoid disposing uncompleted task in LinuxEnvironmentStatistics (dotne…
Browse files Browse the repository at this point in the history
  • Loading branch information
galvesribeiro committed Jan 12, 2021
1 parent 0c9cce2 commit 404edb8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public LinuxEnvironmentStatistics(ILoggerFactory loggerFactory)

public void Dispose()
{
_cts?.Dispose();
_monitorTask?.Dispose();
if (_cts != null && !_cts.IsCancellationRequested)
{
_cts.Cancel();
}
}

public void Participate(ISiloLifecycle lifecycle)
Expand Down

0 comments on commit 404edb8

Please sign in to comment.