Mercurial > servermonitor
comparison ServerMonitor/Forms/CheckForm.cs @ 16:7626b099aefd
More comments.
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Tue, 30 Apr 2019 20:40:58 -0400 |
parents | 23f2e0da1094 |
children | 48044d9ac000 |
comparison
equal
deleted
inserted
replaced
15:23f2e0da1094 | 16:7626b099aefd |
---|---|
248 // while cancellationTokenSource might end up referencing a different token if the Cancel | 248 // while cancellationTokenSource might end up referencing a different token if the Cancel |
249 // button is clicked (but the Task itself is unable to be cancelled), then Run is clicked | 249 // button is clicked (but the Task itself is unable to be cancelled), then Run is clicked |
250 // again. | 250 // again. |
251 CancellationTokenSource localCancellationTokenSource = new CancellationTokenSource(); | 251 CancellationTokenSource localCancellationTokenSource = new CancellationTokenSource(); |
252 cancellationTokenSource = localCancellationTokenSource; | 252 cancellationTokenSource = localCancellationTokenSource; |
253 // Do not update the check status or execution history when the check is run interactively. | |
254 // No need to pollute the history with manual executions that will likely fail as a | |
255 // check is being configured. | |
253 CheckResult result = await workCheck.ExecuteAsync(cancellationTokenSource.Token, false); | 256 CheckResult result = await workCheck.ExecuteAsync(cancellationTokenSource.Token, false); |
254 if (!localCancellationTokenSource.IsCancellationRequested) | 257 if (!localCancellationTokenSource.IsCancellationRequested) |
255 OnRunFinished(result); | 258 OnRunFinished(result); |
256 localCancellationTokenSource.Dispose(); | 259 localCancellationTokenSource.Dispose(); |
257 localCancellationTokenSource = null; | 260 localCancellationTokenSource = null; |