diff --git a/lib/Alchemy/Phrasea/WorkerManager/Controller/AdminConfigurationController.php b/lib/Alchemy/Phrasea/WorkerManager/Controller/AdminConfigurationController.php index 1477ceba94..269e5d4bec 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Controller/AdminConfigurationController.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Controller/AdminConfigurationController.php @@ -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); diff --git a/lib/Alchemy/Phrasea/WorkerManager/Queue/MessageHandler.php b/lib/Alchemy/Phrasea/WorkerManager/Queue/MessageHandler.php index 7f13668903..55ee1914b4 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Queue/MessageHandler.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Queue/MessageHandler.php @@ -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);