fix memory leak, try something different for metrics
This commit is contained in:
@@ -174,7 +174,8 @@ namespace MareSynchronosServer.Hubs
|
||||
{
|
||||
var decodedFile = LZ4.LZ4Codec.Unwrap(uploadedFile.ToArray());
|
||||
using var sha1 = SHA1.Create();
|
||||
var computedHash = await sha1.ComputeHashAsync(new MemoryStream(decodedFile));
|
||||
using var ms = new MemoryStream(decodedFile);
|
||||
var computedHash = await sha1.ComputeHashAsync(ms);
|
||||
var computedHashString = BitConverter.ToString(computedHash).Replace("-", "");
|
||||
if (hash != computedHashString)
|
||||
{
|
||||
|
||||
@@ -114,7 +114,8 @@ namespace MareSynchronosServer
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseMetricServer(4980);
|
||||
var metricServer = new KestrelMetricServer(4980);
|
||||
metricServer.Start();
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user