This commit is contained in:
@@ -21,13 +21,18 @@ namespace rockfishCore.Util
|
||||
private const string S3_HOST_ENDPOINT = "https://nyc3.digitaloceanspaces.com";
|
||||
private const string S3_BUCKET_NAME = "gztw1";
|
||||
|
||||
private static HttpClient Client = new HttpClient();
|
||||
private static readonly HttpClient _httpClient;
|
||||
|
||||
|
||||
static OpsDiagnostics()
|
||||
{
|
||||
_httpClient = new HttpClient();
|
||||
}
|
||||
|
||||
public static bool CheckWebsite(string url, string mustContain)
|
||||
{
|
||||
bool Result = false;
|
||||
var Response = Client.GetAsync(url).Result;
|
||||
var Response = _httpClient.GetAsync(url).Result;
|
||||
if (Response.IsSuccessStatusCode)
|
||||
{
|
||||
var PageText = Response.Content.ReadAsStringAsync().Result;
|
||||
@@ -73,9 +78,11 @@ namespace rockfishCore.Util
|
||||
}
|
||||
};
|
||||
|
||||
var httpClient = new HttpClient(httpClientHandler);
|
||||
await httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Head, url));
|
||||
|
||||
using (var httpClient = new HttpClient(httpClientHandler))
|
||||
{
|
||||
await httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Head, url));
|
||||
//httpClient.Dispose();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user