You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a couple of things that could be done to this module to make it work more nicely with queuedjobs.
Come bundled with a crontask for running the job queue
Reduce the amount of boilerplate needed to do crontask that adds a buildtask-execution to the job queue (a handy pattern for managing your background tasks)
The following is used in a specific project to hook up queuedjobs. With a bit of checking to bypass the CronTask if Symbiote\QueuedJobs\Tasks\ProcessJobQueueTask didn't exist, it could be bundled in the crontask package.
However, it would probably necessitate a major version bump of this package, as people would need to disable any other executions of ProcessJobQueueTask they had set up.
Would that be reasonable?
<?php
use SilverStripe\CronTask\Interfaces\CronTask;
use Symbiote\QueuedJobs\Tasks\ProcessJobQueueTask;
use SilverStripe\Control\HTTPRequest;
/**
* Trigger the queuedjob running from CronTask
*/
class QueuedJobsCron implements CronTask
{
/**
* Run every 6 hours
*
* @return string
*/
public function getSchedule()
{
return "* * * * *";
}
/**
* Run the build task SilverStripeElasticaReindexTask
* @return void
*/
public function process()
{
echo "Running ProcessJobQueueTask via CronTask...\n";
$task = new ProcessJobQueueTask();
$request = new HTTPRequest('GET', '/', []);
$task->run($request);
}
}
There's a couple of things that could be done to this module to make it work more nicely with queuedjobs.
This might be facilitated with #9
The text was updated successfully, but these errors were encountered: