[後端] 調整後台同步http request時間限制無上限

This commit is contained in:
dev02 2023-09-26 18:24:03 +08:00
parent c324a37fe9
commit cfdd360702

View File

@ -150,6 +150,7 @@ namespace Backend.Services.Implement
streamWriter.Write(json); streamWriter.Write(json);
} }
cp_Postrequest.Timeout = System.Threading.Timeout.Infinite;
HttpWebResponse cp_response = (HttpWebResponse)cp_Postrequest.GetResponse(); HttpWebResponse cp_response = (HttpWebResponse)cp_Postrequest.GetResponse();
var cp_responseString = new StreamReader(cp_response.GetResponseStream()).ReadToEnd(); var cp_responseString = new StreamReader(cp_response.GetResponseStream()).ReadToEnd();
@ -183,6 +184,7 @@ namespace Backend.Services.Implement
Postrequest.Method = "GET"; Postrequest.Method = "GET";
Postrequest.Headers.Add("Authorization", "Basic " + encoded); Postrequest.Headers.Add("Authorization", "Basic " + encoded);
Postrequest.PreAuthenticate = true; Postrequest.PreAuthenticate = true;
Postrequest.Timeout = System.Threading.Timeout.Infinite;
HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse(); HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
@ -201,6 +203,7 @@ namespace Backend.Services.Implement
Postrequest2.Method = "GET"; Postrequest2.Method = "GET";
Postrequest2.Headers.Add("Authorization", "Basic " + encoded); Postrequest2.Headers.Add("Authorization", "Basic " + encoded);
Postrequest2.PreAuthenticate = true; Postrequest2.PreAuthenticate = true;
Postrequest2.Timeout = System.Threading.Timeout.Infinite;
HttpWebResponse response2 = (HttpWebResponse)Postrequest2.GetResponse(); HttpWebResponse response2 = (HttpWebResponse)Postrequest2.GetResponse();
var responseString2 = new StreamReader(response2.GetResponseStream()).ReadToEnd(); var responseString2 = new StreamReader(response2.GetResponseStream()).ReadToEnd();
@ -498,6 +501,7 @@ namespace Backend.Services.Implement
Postrequest.Method = "GET"; Postrequest.Method = "GET";
Postrequest.Headers.Add("Authorization", "Basic " + encoded); Postrequest.Headers.Add("Authorization", "Basic " + encoded);
Postrequest.PreAuthenticate = true; Postrequest.PreAuthenticate = true;
Postrequest.Timeout = System.Threading.Timeout.Infinite;
HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse(); HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
@ -517,6 +521,7 @@ namespace Backend.Services.Implement
Postrequest2.Method = "GET"; Postrequest2.Method = "GET";
Postrequest2.Headers.Add("Authorization", "Basic " + encoded); Postrequest2.Headers.Add("Authorization", "Basic " + encoded);
Postrequest2.PreAuthenticate = true; Postrequest2.PreAuthenticate = true;
Postrequest2.Timeout = System.Threading.Timeout.Infinite;
HttpWebResponse response2 = (HttpWebResponse)Postrequest2.GetResponse(); HttpWebResponse response2 = (HttpWebResponse)Postrequest2.GetResponse();
var responseString2 = new StreamReader(response2.GetResponseStream()).ReadToEnd(); var responseString2 = new StreamReader(response2.GetResponseStream()).ReadToEnd();