Add an eviction policy to the GBPriceCache.
Some checks failed
Build .NET Project / build (push) Has been cancelled

This commit is contained in:
2026-03-11 19:02:48 -04:00
parent 7e638cca05
commit 84ec9b31a3
3 changed files with 122 additions and 35 deletions

View File

@@ -1,3 +1,4 @@
#pragma warning disable SYSLIB0014
using System.Net;
using System.Text;
using System.IO.Compression;
@@ -1843,18 +1844,27 @@ namespace MarketData.Integration
return webRequest;
}
/// <summary>
/// IsMovedException - MovedPermanently, Found, RedirectKeepVerb, PermanentRedirect will all return a "Location" in the response
/// That we will forward the request to.
/// </summary>
/// <param name="webException"></param>
/// <returns></returns>
private static bool IsMovedException(WebException webException)
{
if(webException.Status.Equals(WebExceptionStatus.ProtocolError))
if (webException.Status.Equals(WebExceptionStatus.ProtocolError))
{
HttpWebResponse response = webException.Response as HttpWebResponse;
if(response.StatusCode.Equals(HttpStatusCode.MovedPermanently))
if (response.StatusCode.Equals(HttpStatusCode.MovedPermanently) ||
response.StatusCode.Equals(HttpStatusCode.Found) ||
response.StatusCode.Equals(HttpStatusCode.RedirectKeepVerb) ||
response.StatusCode.Equals(HttpStatusCode.PermanentRedirect))
{
return true;
return true;
}
}
}
return false;
}
}
/// <summary>
/// Get the proxy for the specified service or null if it is not congfigured to use the proxy
@@ -1921,3 +1931,4 @@ namespace MarketData.Integration
}
}
}
#pragma warning restore SYSLIB0014