diff
This commit is contained in:
@@ -25,6 +25,7 @@ using Newtonsoft.Json.Linq;
|
||||
|
||||
using static C4IT.Logging.cLogManager;
|
||||
using C4IT.Configuration;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
|
||||
namespace C4IT.FASD.Cockpit.Communication
|
||||
{
|
||||
@@ -566,6 +567,38 @@ namespace C4IT.FASD.Cockpit.Communication
|
||||
return false;
|
||||
}
|
||||
|
||||
public override async Task<cCollectorStatusInfo> CheckCollectorStatusAsync()
|
||||
{
|
||||
var CM = MethodBase.GetCurrentMethod();
|
||||
LogMethodBegin(CM);
|
||||
var apiError = 0;
|
||||
var timeStart = DateTime.UtcNow;
|
||||
try
|
||||
{
|
||||
var http = GetHttpHelper(false);
|
||||
|
||||
var result = await http.GetHttpJson("api/CheckCollectorStatus", 15000, CancellationToken.None);
|
||||
|
||||
if (!result.IsOk)
|
||||
{
|
||||
apiError = (int)result.Status;
|
||||
return null;
|
||||
}
|
||||
var strXml = JsonConvert.DeserializeObject<cCollectorStatusInfo>(result.Result);
|
||||
return strXml;
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
apiError = E.HResult;
|
||||
LogException(E);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (Debug_apiTiming) SaveApiTimingEntry("Check Collector Status", timeStart, apiError);
|
||||
LogMethodEnd(CM);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public override async Task<cFasdBaseConfig> GetConfiguration(enumFasdConfigurationType configType)
|
||||
{
|
||||
@@ -2124,6 +2157,6 @@ namespace C4IT.FASD.Cockpit.Communication
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user