fix validation
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user