private void HandleJobComplete(JobWorker.JobComplete ic) { _logger.Info("{0} : JobComplete : {1}", ic.Job.JobInfo.Id, ic.JobStatusUpdate.TotalElapsed); JobWorkerInfo workerInfo; CurrentJobs.TryGetValue(ic.Job, out workerInfo); if (workerInfo != null) { if (workerInfo.JobWorkerRef != null) { Context.Unwatch(workerInfo.JobWorkerRef); } workerInfo.JobStatusUpdate = ic.JobStatusUpdate; workerInfo.SetWorkerRef(null); CurrentJobs.AddOrUpdate(ic.Job, workerInfo, (key, oldvalue) => workerInfo); } }
private void HandleReceivedJobStatus(JobWorker.ReceivedJobStatus ic) { JobWorkerInfo workerInfo; if (CurrentJobs.TryGetValue(ic.Job, out workerInfo)) { workerInfo.JobStatusUpdate = ic.RunningStatus; // If we are finished then we shouldn't have a worker reference. if (workerInfo.JobStatusUpdate.Status == JobStatus.Finished) { workerInfo.SetWorkerRef(null); _logger.Warning("{0} : Removing JobWorkerRef as the status is Finished. This might be due to not receiving the JobComplete message???", ic.Job.JobInfo.Id); } CurrentJobs.AddOrUpdate(ic.Job, workerInfo, (key, oldvalue) => workerInfo); } }