/// <summary> /// Execute query only and do not upload results /// </summary> /// <param name="qdm">Query to be processed</param> private void ProcessRequest(HubRequest request) { Log.Info(string.Format("BackgroundProcess: Processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2})", request.Source.Identifier, request.DataMartId, request.NetworkId, request.Source.ID)); try { var key = MakeKey(request); if (RequestStatuses.ContainsKey(key)) { RequestStatuses[key] = ProcessingStatus.InProcessing; } string requestId = ProcessRequest(request, request.Processor); RequestStatus.StatusCode statusCode = request.Processor.Status(requestId).Code; if (statusCode == RequestStatus.StatusCode.Error) { HubRequestStatus hubRequestStatus = DnsServiceManager.ConvertModelRequestStatus(request.Processor.Status(requestId)); hubRequestStatus.Message = request.Processor.Status(requestId).Message; DnsServiceManager.SetRequestStatus(request, hubRequestStatus, request.Properties, _networkSetting); } Log.Info(String.Format("The following query {3} (ID: {0}) was executed on behalf of {1}:\n\n{2}", request.Source.ID, _networkSetting.Profile.Username, "", request.Source.Identifier)); } catch (Exception ex) { string message = string.Format("BackgroundProcess: An error occurred when processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2}", request.Source.Identifier, request.DataMartId, request.NetworkId, request.Source.ID); Log.Error(message, ex); DnsServiceManager.SetRequestStatus(request, new HubRequestStatus(Lpp.Dns.DTO.DataMartClient.Enums.DMCRoutingStatus.Failed, message), request.Properties, _networkSetting); } Log.Info(string.Format("BackgroundProcess: Finished processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2})", request.Source.Identifier, request.DataMartId, request.NetworkId, request.Source.ID)); }
/// <summary> /// Execute query only and do not upload results /// </summary> /// <param name="qdm">Query to be processed</param> private void ProcessRequest(HubRequest request) { NetWorkSetting networkSetting = Configuration.Instance.GetNetworkSetting(request.NetworkId); _log.Info(String.Format("BackgroundProcess: Processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2})", request.Source.Identifier, request.DataMartId, networkSetting.NetworkId, request.Source.ID)); try { string requestId = ProcessRequest(request, request.Processor, networkSetting); RequestStatus.StatusCode statusCode = request.Processor.Status(requestId).Code; if (request.RoutingStatus == Lpp.Dns.DTO.DataMartClient.Enums.DMCRoutingStatus.Failed) { HubRequestStatus hubRequestStatus = DnsServiceManager.ConvertModelRequestStatus(request.Processor.Status(requestId)); hubRequestStatus.Message = request.Processor.Status(requestId).Message; DnsServiceManager.SetRequestStatus(request, hubRequestStatus, request.Properties, networkSetting); } else { DnsServiceManager.SetRequestStatus(request, DnsServiceManager.ConvertModelRequestStatus(request.Processor.Status(requestId)), request.Properties, networkSetting); } _log.Info(String.Format("The following query {3} (ID: {0}) was executed on behalf of {1}:\n\n{2}", request.Source.ID, networkSetting.Profile.Username, "", request.Source.Identifier)); } catch (Exception ex) { string message = string.Format("BackgroundProcess: An error occurred when processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2}", request.Source.Identifier, request.DataMartId, networkSetting.NetworkId, request.Source.ID); _log.Error(message, ex); DnsServiceManager.SetRequestStatus(request, new HubRequestStatus(Lpp.Dns.DTO.DataMartClient.Enums.DMCRoutingStatus.Failed, message), request.Properties, networkSetting); } _log.Info(String.Format("BackgroundProcess: Finished processing request {0} (RequestID: {3}, DataMartId: {1}, NetworkId: {2})", request.Source.Identifier, request.DataMartId, networkSetting.NetworkId, request.Source.ID)); }