public async Task Cancel() { _context.Cancel(); try { await JobTask.OrTimeout(TimeSpan.FromSeconds(30)).ConfigureAwait(false); } catch (OperationCanceledException) { } }
public async Task Cancel() { if (_context.CancellationToken.IsCancellationRequested) { return; } _context.Cancel(); try { await JobTask.OrTimeout(TimeSpan.FromSeconds(30)).ConfigureAwait(false); } catch (OperationCanceledException) { } }