Fixed Server based job trigger still allows AJAX requests to trigger non-blocking auto jobs

Sim

Well-known member
Affected version
2.2b1
XF\Mvc\Renderer\Json::addDefaultJsonParams sets parameters for jobs including a flag to indicate whether we have auto (non-blocking) run jobs to execute.

I believe we should be leaving these non-blocking jobs to the run-jobs CLI command rather than executing them while completing the AJAX request?

My recommendation is to change the line (#222 in 2.2b1):
PHP:
$autoJobs = $jobManager->hasAutoEnqueued();

to something like:

PHP:
if (!empty(\XF::options()->jobRunTrigger) && \XF::options()->jobRunTrigger == 'activity')
{
    $autoJobs = $jobManager->hasAutoEnqueued();
}
else
{
    $autoJobs = false;
}

... unless there is a reason why we need to have non-blocking auto jobs run during AJAX requests?
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 Beta 2).

Change log:
Only run automatic jobs following AJAX requests when using activity based job triggering
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom