Querying Awaiting State Status

How did i query the awaiting state?

My usecase: Only one file at a time can be processed.

My code is as follows:

  if (processingJobs.Any(x => x.Value.Job.Method.Name == Constants.FileProcessingMethod))
        {
            var parentjobID = processingJobs.LastOrDefault(x =>
                x.Value.Job.Method.Name == Constants.FileProcessingMethod).Key;
            JobManager.ContinueWithHangFire<BehaviorManager>(parentjobID,
                x => x.ProcessFileUploadActivityBehavior(activity.ActivityId));
        }
        else
        {
            JobManager.EnqueueHangFire<BehaviorManager>(x => x.ProcessFileUploadActivityBehavior(activity.ActivityId));
        }

The problem comes with the processing state. I also need a way to query for awaiting jobs. I thought the MonitorAPI call is getenqueuejob. The call requires a queue parameter. I never have any queues unless i force a job into one thats not default. If I use default i get no results.

Fullscreen_081718_112436_AM

I need to queue up jobs using the last awaiting state job.

I’m also ready to write my own sqlreading and by pass the api.

Thanks!

Hi @kkohler21 is there any update about your question? I have the same logic as yours so I need to find jobs that are awaiting status but I couldn’t find a solution to get them.