mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 13:28:27 +01:00
Pass cancellation where possible
This commit is contained in:
@@ -99,7 +99,7 @@ namespace Emby.Server.Implementations.Updates
|
||||
{
|
||||
using var response = await _httpClientFactory.CreateClient(NamedClient.Default)
|
||||
.GetAsync(manifest, cancellationToken).ConfigureAwait(false);
|
||||
await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -241,7 +241,8 @@ namespace Emby.Server.Implementations.Updates
|
||||
_currentInstallations.Add(tuple);
|
||||
}
|
||||
|
||||
var linkedToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, innerCancellationTokenSource.Token).Token;
|
||||
using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, innerCancellationTokenSource.Token);
|
||||
var linkedToken = linkedTokenSource.Token;
|
||||
|
||||
await _eventManager.PublishAsync(new PluginInstallingEventArgs(package)).ConfigureAwait(false);
|
||||
|
||||
@@ -333,7 +334,7 @@ namespace Emby.Server.Implementations.Updates
|
||||
|
||||
using var response = await _httpClientFactory.CreateClient(NamedClient.Default)
|
||||
.GetAsync(package.SourceUrl, cancellationToken).ConfigureAwait(false);
|
||||
await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// CA5351: Do Not Use Broken Cryptographic Algorithms
|
||||
#pragma warning disable CA5351
|
||||
|
||||
Reference in New Issue
Block a user