mirror of
https://github.com/Radarr/Radarr
synced 2025-02-20 21:37:18 +00:00
Fixed: Resource leakage inside HttpClient.
This commit is contained in:
parent
df18c34878
commit
c83995adc1
1 changed files with 7 additions and 5 deletions
|
@ -226,11 +226,13 @@ public void DownloadFile(string url, string fileName)
|
|||
_logger.Debug("Downloading [{0}] to [{1}]", url, fileName);
|
||||
|
||||
var stopWatch = Stopwatch.StartNew();
|
||||
var webClient = new GZipWebClient();
|
||||
webClient.Headers.Add(HttpRequestHeader.UserAgent, UserAgentBuilder.UserAgent);
|
||||
webClient.DownloadFile(url, fileName);
|
||||
stopWatch.Stop();
|
||||
_logger.Debug("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds);
|
||||
using (var webClient = new GZipWebClient())
|
||||
{
|
||||
webClient.Headers.Add(HttpRequestHeader.UserAgent, UserAgentBuilder.UserAgent);
|
||||
webClient.DownloadFile(url, fileName);
|
||||
stopWatch.Stop();
|
||||
_logger.Debug("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds);
|
||||
}
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue