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