mirror of
https://github.com/Caraxi/mare.client.git
synced 2026-02-21 10:17:42 +01:00
fix validation
This commit is contained in:
parent
4e715c8eb3
commit
325e7d1626
1 changed files with 11 additions and 3 deletions
|
|
@ -100,10 +100,18 @@ public sealed class FileCacheManager : IHostedService
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var computedHash = Crypto.GetFileHash(fileCache.ResolvedFilepath);
|
try
|
||||||
if (!string.Equals(computedHash, fileCache.Hash, StringComparison.Ordinal))
|
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Failed to validate {file}, got hash {hash}, expected hash {hash}", fileCache.ResolvedFilepath, computedHash, fileCache.Hash);
|
var computedHash = Crypto.GetFileHash(fileCache.ResolvedFilepath);
|
||||||
|
if (!string.Equals(computedHash, fileCache.Hash, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Failed to validate {file}, got hash {hash}, expected hash {hash}", fileCache.ResolvedFilepath, computedHash, fileCache.Hash);
|
||||||
|
brokenEntities.Add(fileCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Error during validation of {file}", fileCache.ResolvedFilepath);
|
||||||
brokenEntities.Add(fileCache);
|
brokenEntities.Add(fileCache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue