Esempio n. 1
0
 protected override void RunJobImplementation()
 {
     // clear out all dirty nodes since the whole network is being run.
     DbContext.DirtyModelNodes.DeleteDirtyModelNode(DbContext.DirtyModelNodes.ToList());
     NereidUtilities.TotalNetworkSolve(out _, out _, out _, DbContext, HttpClient, true);
     NereidUtilities.TotalNetworkSolve(out _, out _, out _, DbContext, HttpClient, false);
 }
Esempio n. 2
0
        public ActionResult SolveSOC()
        {
            var failed           = false;
            var exceptionMessage = "";
            var stackTrace       = "";
            var missingNodeIDs   = new List <string>();
            var graph            = new Graph();

            try
            {
                NereidUtilities.TotalNetworkSolve(out stackTrace, out missingNodeIDs,
                                                  out graph, HttpRequestStorage.DatabaseEntities, HttpClient, true);
            }
            catch (NereidException <SolutionRequestObject, SolutionResponseObject> nexc)
            {
                var data = new SolutionSummary
                {
                    NodesProcessed           = graph.Nodes.Count(x => x.Results != null),
                    MissingNodeIDs           = missingNodeIDs,
                    Failed                   = true,
                    ExceptionMessage         = nexc.Message,
                    InnerExceptionStackTrace = nexc.InnerException?.StackTrace,
                    FailingRequest           = nexc.Request,
                    FailureResponse          = nexc.Response
                };

                {
                    return(Content(JsonConvert.SerializeObject(data)));
                }
            }
            catch (Exception exception)
            {
                failed           = true;
                exceptionMessage = exception.Message;
                stackTrace       = exception.StackTrace;
            }


            return(Json(
                       new SolutionSummary()
            {
                NodesProcessed = graph.Nodes.Count(x => x.Results != null),
                MissingNodeIDs = missingNodeIDs,
                Failed = failed,
                ExceptionMessage = exceptionMessage,
                InnerExceptionStackTrace = stackTrace
            }, JsonRequestBehavior.AllowGet));
        }