Create new prio queue for publishing events

pull/1303/head
Richard van den Berg 2016-06-24 11:03:47 +02:00
parent 009b0d0786
commit 117d001b2f
3 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
cd "${0%/*}"
../cake CakeResque.CakeResque stop --all
../cake CakeResque.CakeResque start --interval 5 --queue default
../cake CakeResque.CakeResque start --interval 5 --queue prio
../cake CakeResque.CakeResque start --interval 5 --queue cache
../cake CakeResque.CakeResque start --interval 5 --queue email
../cake CakeResque.CakeResque startscheduler -i 5

View File

@ -25,7 +25,7 @@ class JobsController extends AppController {
if (!$this->_isSiteAdmin()) throw new MethodNotAllowedException();
if (!Configure::read('MISP.background_jobs')) throw new NotFoundException('Background jobs are not enabled on this instance.');
$this->recursive = 0;
$queues = array('email', 'default', 'cache');
$queues = array('email', 'default', 'cache', 'prio');
if ($queue && in_array($queue, $queues)) $this->paginate['conditions'] = array('Job.worker' => $queue);
$jobs = $this->paginate();
foreach ($jobs as &$job) {

View File

@ -2165,7 +2165,7 @@ class Event extends AppModel {
$job = ClassRegistry::init('Job');
$job->create();
$data = array(
'worker' => 'default',
'worker' => 'prio',
'job_type' => 'publish_event',
'job_input' => 'Event ID: ' . $id,
'status' => 0,