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.
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!