Example #1
0
        public static JobQueueRequestResult GetResult(JobQueueRequest queueRequest)
        {
            if (queueRequest == null)
            {
                return(null);
            }

            object _lock = new object();

            lock (_lock)
            {
                var queueRequestResult = new JobQueueRequestResult();

                queueRequestResult.IntegrationId        = queueRequest.JobInstances.Count > 0 ? queueRequest.JobInstances[0].Integration.Id : Guid.Empty;
                queueRequestResult.JobId                = queueRequest.Job.Id;
                queueRequestResult.QueueRequestId       = queueRequest.Id;
                queueRequestResult.InvocationSourceType = queueRequest.InvocationSourceType;
                queueRequestResult.Status               = queueRequest.Status;

                var jobResults = new List <JobInstanceResult>();

                foreach (var jobInstance in queueRequest.JobInstances)
                {
                    jobResults.Add(GetResult(jobInstance));
                }

                queueRequestResult.JobInstanceResults = jobResults;

                return(queueRequestResult);
            }
        }
Example #2
0
        public static JobQueueRequestResult GetQueueRequestResult(Guid queueRequestId)
        {
            JobQueueRequestResult queueRequestResult = null;
            JobQueueRequest       queueRequest;

            object _lock = new object();

            lock (_lock)
            {
                queueRequestsById.TryGetValue(queueRequestId, out queueRequest);

                if (queueRequest != null)
                {
                    queueRequestResult = JobQueueResult.GetResult(queueRequest);
                }
            }

            return(queueRequestResult);
        }