Пример #1
0
 public void QueueJob(Job job)
 {
     Logging.LogDebug("Queueing Job Id {0}", job.JobId);
     _jobExecutionStatus.TryAdd(job.JobId.ToString(), new JobExecutionStatus { JobId = job.JobId, JobStatus = JobStatus.Pending });
     _jobs.Enqueue(job);
 }
 public JobCompletedEventArgs(string storeId, Job completedJob)
 {
     StoreId = storeId;
     CompletedJob = completedJob;
 }
Пример #3
0
 public void QueueJob(Job job, bool incrementTransactionCount = true)
 {
     Logging.LogDebug("Queueing Job Id {0}", job.JobId);
     bool queuedJob = false;
     while (!queuedJob)
     {
         if (
             _jobExecutionStatus.TryAdd(job.JobId.ToString(),
                                        new JobExecutionStatus {JobId = job.JobId, JobStatus = JobStatus.Pending}))
         {
             _jobs.Enqueue(job);
             queuedJob = true;
             Logging.LogDebug("Queued Job Id {0}", job.JobId);
             _statsMonitor.OnJobScheduled(incrementTransactionCount);
         }
     }
 }
Пример #4
0
 private void RaiseTransactionCommitting(Job job)
 {
     if (JobCompleted != null)
     {
         JobCompleted(this, new JobCompletedEventArgs(_storeName, job));
     }
 }