From an event plugin, checking if a job is running or queued

Hi there,

I am writing a Event Plugin in which in want to identify if a job is running or queued.
Unfortunately, the job.JobStatus is Active in both case…

Is there a simple way to have this detailed information (without infering it from parsing the Task statuses) ?

Thanks,
Jerome

Unfortunately there’s no difference (as you’ve found) between queued and rendering as far as jobstatus is concerned. It seems like it’s mostly used for dependency tracking, where ‘needs to be rendered’ and ‘rendering’ are equivalent.

But I did find an example where we’re differentiating between the two in the FTrack integration. We’re checking the number of tasks in the rendering state (called chunks internally):

    if dlStatus == JobStatus.Active:
        if job.RenderingChunks > 0:
            statusName = config.GetConfigEntryWithDefault( "VersionStatusStarted", "" ).strip()
        else:
            statusName = config.GetConfigEntryWithDefault( "VersionStatusQueued", "" ).strip()

That should do the trick and not require pulling in task objects from the job.

1 Like

Awesome, it does the trick indeed !
While looking into the latest API reference, I could only find a reference to job.RenderingTasks which seems to be broken actually with our version (10.1.20.2).

Thanks !

Do you mean JobRenderingTasks? Given the age of the FTrack plugin I’d bet that it used to be named RenderingChunks and we moved the customer-facing names over at some point.

Though (and this gets me all the time) you’d use it as job.JobRenderingTasks. There’s something about the properties that have the class name at the start that trip me up.

You’re right I meant Job.JobRenderingTasks.
The old Job.RenderingChunks actually still works on our version but I’m guessing it is deprecated and might be removed in the futur.

Thanks