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"; }
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); }
public void UpdateJob(Job job) { _jobCollection.Save(job); }