fixed xml providers running over and over

This commit is contained in:
Luke Pulverenti
2013-10-01 14:24:27 -04:00
parent 900266eb54
commit 3d40c5ba36
42 changed files with 323 additions and 395 deletions

View File

@@ -220,10 +220,10 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
{
options.ResourcePool.Release();
}
throw new HttpException(string.Format("Connection to {0} timed out", options.Url)) { IsTimedOut = true };
}
_logger.Info("HttpClientManager.Get url: {0}", options.Url);
try
@@ -512,10 +512,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
if (operationCanceledException != null)
{
// Cleanup
if (File.Exists(tempFile))
{
File.Delete(tempFile);
}
DeleteTempFile(tempFile);
return GetCancellationException(options.Url, options.CancellationToken, operationCanceledException);
}
@@ -525,10 +522,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
var httpRequestException = ex as HttpRequestException;
// Cleanup
if (File.Exists(tempFile))
{
File.Delete(tempFile);
}
DeleteTempFile(tempFile);
if (httpRequestException != null)
{
@@ -538,6 +532,18 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
return ex;
}
private void DeleteTempFile(string file)
{
try
{
File.Delete(file);
}
catch (IOException)
{
// Might not have been created at all. No need to worry.
}
}
/// <summary>
/// Validates the params.
/// </summary>