for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Symbiote\QueuedJobs\Workers;
use SilverStripe\ORM\DataList;
/**
* @author [email protected]
* @license BSD License http://silverstripe.org/bsd-license/
*/
// GearmanHandler is an extension that could be not available.
* @todo Test and implement against it for SilverStripe 4.x compatibility
if (interface_exists('GearmanHandler')) {
class JobWorker implements \GearmanHandler
{
* @var QueuedJobService
public $queuedJobService;
* @return string
public function getName()
return 'jobqueueExecute';
}
* @param int $jobId
* @return void
public function jobqueueExecute($jobId)
$this->queuedJobService->checkJobHealth();
$job = DataList::create('Symbiote\\QueuedJobs\\DataObjects\\QueuedJobDescriptor')->byID($jobId);
if ($job) {
// check that we're not trying to execute something tooo soon
if (strtotime($job->StartAfter) > time()) {
return;
$this->queuedJobService->runJob($jobId);