|
@@ -75,7 +75,15 @@ namespace Vinno.vCloud.Common.FIS
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (speedResults[fasterServer] > result.Value)
|
|
|
+ if (fasterServer.Host == "cloud.xinglinghui.com" && speedResults[fasterServer] > result.Value + 5)
|
|
|
+ {
|
|
|
+ fasterServer = result.Key;
|
|
|
+ }
|
|
|
+ else if (result.Key.Host == "cloud.xinglinghui.com" && speedResults[fasterServer] > result.Value - 5)
|
|
|
+ {
|
|
|
+ fasterServer = result.Key;
|
|
|
+ }
|
|
|
+ else if (speedResults[fasterServer] > result.Value)
|
|
|
{
|
|
|
fasterServer = result.Key;
|
|
|
}
|
|
@@ -170,7 +178,7 @@ namespace Vinno.vCloud.Common.FIS
|
|
|
}
|
|
|
var successTimes = 0;
|
|
|
var totalTime = 0;
|
|
|
- for (var i = 0; i < 3; i++)
|
|
|
+ for (var i = 0; i < 4; i++)//第一次为预热
|
|
|
{
|
|
|
if (i > 0)
|
|
|
{
|
|
@@ -186,7 +194,7 @@ namespace Vinno.vCloud.Common.FIS
|
|
|
{
|
|
|
var content = result.Content.ReadAsStringAsync()?.Result;
|
|
|
stopWatch.Stop();
|
|
|
- if (result.IsSuccessStatusCode && content.Length > 0)
|
|
|
+ if (result.IsSuccessStatusCode && content.Length > 0 && i > 0)
|
|
|
{
|
|
|
Logger.WriteLineInfo($"Connect serverUrl:{serverUrl}, spend time:{stopWatch.ElapsedMilliseconds}ms");
|
|
|
totalTime += (int)stopWatch.ElapsedMilliseconds;
|