mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 22:13:06 +03:00
fixed xml providers running over and over
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user