delete temporary created files

This commit is contained in:
Stanley Dimant
2022-08-29 09:27:43 +02:00
parent 3a6c9259a0
commit 507c7cac11

View File

@@ -225,6 +225,8 @@ namespace MareSynchronosServer.Hubs
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }
await streamingCall.RequestStream.CompleteAsync(); await streamingCall.RequestStream.CompleteAsync();
tempFileStream.Close();
await tempFileStream.DisposeAsync();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -232,6 +234,10 @@ namespace MareSynchronosServer.Hubs
_dbContext.Remove(relatedFile); _dbContext.Remove(relatedFile);
await _dbContext.SaveChangesAsync().ConfigureAwait(false); await _dbContext.SaveChangesAsync().ConfigureAwait(false);
} }
finally
{
File.Delete(tempFileName);
}
} }
} }
} }