mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-17 02:49:05 -07:00
update ping test
This commit is contained in:
parent
3c75008483
commit
c30bea9a70
@ -123,9 +123,9 @@ namespace MediaBrowser.Api.System
|
|||||||
return ToOptimizedResult(result);
|
return ToOptimizedResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Post(PingSystem request)
|
public object Post(PingSystem request)
|
||||||
{
|
{
|
||||||
|
return _appHost.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object Get(GetServerLogs request)
|
public object Get(GetServerLogs request)
|
||||||
|
@ -1173,17 +1173,27 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
{
|
{
|
||||||
Url = apiUrl,
|
Url = apiUrl,
|
||||||
LogErrorResponseBody = false,
|
LogErrorResponseBody = false,
|
||||||
LogErrors = false
|
LogErrors = false,
|
||||||
|
LogRequest = false
|
||||||
|
|
||||||
}, "POST").Result)
|
}, "POST").Result)
|
||||||
{
|
{
|
||||||
_validAddressResults.AddOrUpdate(apiUrl, true, (k, v) => true);
|
using (var reader = new StreamReader(response.Content))
|
||||||
return true;
|
{
|
||||||
|
var result = reader.ReadToEnd();
|
||||||
|
var valid = string.Equals(Name, result, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
_validAddressResults.AddOrUpdate(apiUrl, valid, (k, v) => valid);
|
||||||
|
Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, valid);
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
_validAddressResults.AddOrUpdate(apiUrl, true, (k, v) => false);
|
Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, false);
|
||||||
|
|
||||||
|
_validAddressResults.AddOrUpdate(apiUrl, false, (k, v) => false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user