aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-12-29 14:06:32 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-12-29 14:06:32 -0500
commit3a7329e414834efed93f966a48676230de53c034 (patch)
treef3be9095d8456fe73fb2d31b9a6920790d221070
parenta30cfca862094ddaa931a5f049536860447d064a (diff)
update ping test
-rw-r--r--MediaBrowser.Api/System/SystemService.cs4
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs18
2 files changed, 16 insertions, 6 deletions
diff --git a/MediaBrowser.Api/System/SystemService.cs b/MediaBrowser.Api/System/SystemService.cs
index 4faff8780..539b920a7 100644
--- a/MediaBrowser.Api/System/SystemService.cs
+++ b/MediaBrowser.Api/System/SystemService.cs
@@ -123,9 +123,9 @@ namespace MediaBrowser.Api.System
return ToOptimizedResult(result);
}
- public void Post(PingSystem request)
+ public object Post(PingSystem request)
{
-
+ return _appHost.Name;
}
public object Get(GetServerLogs request)
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index 11949c1ab..8680cff61 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -1181,17 +1181,27 @@ namespace MediaBrowser.Server.Startup.Common
{
Url = apiUrl,
LogErrorResponseBody = false,
- LogErrors = false
+ LogErrors = false,
+ LogRequest = false
}, "POST").Result)
{
- _validAddressResults.AddOrUpdate(apiUrl, true, (k, v) => true);
- return true;
+ using (var reader = new StreamReader(response.Content))
+ {
+ 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
{
- _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;
}
}