mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix setqueue
This commit is contained in:
@@ -235,11 +235,13 @@ class AdminConfigurationController extends Controller
|
|||||||
|
|
||||||
if ($request->getMethod() == 'POST') {
|
if ($request->getMethod() == 'POST') {
|
||||||
$reminderInterval = (int)$request->request->get('worker_reminder_interval');
|
$reminderInterval = (int)$request->request->get('worker_reminder_interval');
|
||||||
// save the period interval in second
|
|
||||||
$app['conf']->set(['workers', 'validationReminder', 'interval'], $reminderInterval);
|
|
||||||
|
|
||||||
/** @var AMQPConnection $serverConnection */
|
/** @var AMQPConnection $serverConnection */
|
||||||
$serverConnection = $this->app['alchemy_worker.amqp.connection'];
|
$serverConnection = $this->app['alchemy_worker.amqp.connection'];
|
||||||
|
$serverConnection->setQueue(MessagePublisher::VALIDATION_REMINDER_QUEUE);
|
||||||
|
|
||||||
|
// save the period interval in second
|
||||||
|
$app['conf']->set(['workers', 'validationReminder', 'interval'], $reminderInterval);
|
||||||
// reinitialize the validation reminder queues
|
// reinitialize the validation reminder queues
|
||||||
$serverConnection->reinitializeQueue([MessagePublisher::VALIDATION_REMINDER_QUEUE]);
|
$serverConnection->reinitializeQueue([MessagePublisher::VALIDATION_REMINDER_QUEUE]);
|
||||||
$this->app['alchemy_worker.message.publisher']->initializeLoopQueue(MessagePublisher::VALIDATION_REMINDER_TYPE);
|
$this->app['alchemy_worker.message.publisher']->initializeLoopQueue(MessagePublisher::VALIDATION_REMINDER_TYPE);
|
||||||
|
@@ -112,14 +112,14 @@ class MessageHandler
|
|||||||
|
|
||||||
private function runConsumer($queueName, AMQPConnection $serverConnection, AMQPChannel $channel, $prefetchCount, $callback)
|
private function runConsumer($queueName, AMQPConnection $serverConnection, AMQPChannel $channel, $prefetchCount, $callback)
|
||||||
{
|
{
|
||||||
|
$serverConnection->setQueue($queueName);
|
||||||
|
|
||||||
// initialize validation reminder when starting consumer
|
// initialize validation reminder when starting consumer
|
||||||
if ($queueName == MessagePublisher::VALIDATION_REMINDER_QUEUE) {
|
if ($queueName == MessagePublisher::VALIDATION_REMINDER_QUEUE) {
|
||||||
$serverConnection->reinitializeQueue([MessagePublisher::VALIDATION_REMINDER_QUEUE]);
|
$serverConnection->reinitializeQueue([MessagePublisher::VALIDATION_REMINDER_QUEUE]);
|
||||||
$this->messagePublisher->initializeLoopQueue(MessagePublisher::VALIDATION_REMINDER_TYPE);
|
$this->messagePublisher->initializeLoopQueue(MessagePublisher::VALIDATION_REMINDER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$serverConnection->setQueue($queueName);
|
|
||||||
|
|
||||||
// give prefetch message to a worker consumer at a time
|
// give prefetch message to a worker consumer at a time
|
||||||
$channel->basic_qos(null, $prefetchCount, null);
|
$channel->basic_qos(null, $prefetchCount, null);
|
||||||
$channel->basic_consume($queueName, Uuid::uuid4(), false, false, false, false, $callback);
|
$channel->basic_consume($queueName, Uuid::uuid4(), false, false, false, false, $callback);
|
||||||
|
Reference in New Issue
Block a user