diff options
| author | Stepan Goremykin <goremukin@gmail.com> | 2023-10-07 23:50:45 +0200 |
|---|---|---|
| committer | Stepan Goremykin <goremukin@gmail.com> | 2023-10-07 23:50:45 +0200 |
| commit | 73309f2649778e50709388e5208404c2dc71b30a (patch) | |
| tree | 7781a0ac384d0cba4ba1722e3bea34d3074e2a81 /Emby.Server.Implementations/Updates/InstallationManager.cs | |
| parent | 8925390ad4c9215755396a531263b654bed4d208 (diff) | |
Pass cancellation token
Diffstat (limited to 'Emby.Server.Implementations/Updates/InstallationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 6c198b6f9..38c3fb4fa 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -524,14 +524,15 @@ namespace Emby.Server.Implementations.Updates using var md5 = MD5.Create(); cancellationToken.ThrowIfCancellationRequested(); - var hash = Convert.ToHexString(md5.ComputeHash(stream)); - if (!string.Equals(package.Checksum, hash, StringComparison.OrdinalIgnoreCase)) + var hash = await md5.ComputeHashAsync(stream, cancellationToken).ConfigureAwait(false); + var hashHex = Convert.ToHexString(hash); + if (!string.Equals(package.Checksum, hashHex, StringComparison.OrdinalIgnoreCase)) { _logger.LogError( "The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}", package.Name, package.Checksum, - hash); + hashHex); throw new InvalidDataException("The checksum of the received data doesn't match."); } |
