예제 #1
0
 public void DoCompare(Job job)
 {
     var request = JsonConvert.DeserializeObject<dynamic>(job.Metadata);
     var comparisons = _service.CompareDynamic(request.requestA, request.requestB);
     job.CompletedId = comparisons[0].Id.ToString();
     job.Status = "C";
 }
예제 #2
0
        public void DoJob(Job job)
        {
            Console.WriteLine("Starting Job: {0}", job.Id);
            try
            {
                switch (job.Type)
                {
                    case "compare":
                        DoCompare(job);
                        break;
                }

                Console.WriteLine("Finished Job: {0}", job.Id);
            }
            catch (Exception e)
            {
                job.Status = "E";
                job.ErrorText = JsonConvert.SerializeObject(e);
                Console.WriteLine("Error Job: {0}", job.Id);
            }

            _db.UpdateJob(job);
        }
예제 #3
0
 public void UpdateJob(Job job)
 {
     _jobCollection.Save(job);
 }