class WallabagV2Controller extends WallabagController
{
/**
- * {@inheritdoc}
+ * @Route("/wallabag-v2", name="import_wallabag_v2")
*/
- protected function getImportService()
+ public function indexAction(Request $request)
{
- return $this->get('wallabag_import.wallabag_v2.import');
+ return parent::indexAction($request);
}
/**
* {@inheritdoc}
*/
- protected function getImportTemplate()
+ protected function getImportService()
{
- return 'WallabagImportBundle:WallabagV2:index.html.twig';
+ $service = $this->get('wallabag_import.wallabag_v2.import');
+
+ if ($this->get('craue_config')->get('import_with_rabbitmq')) {
+ $service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v2_producer'));
+ } elseif ($this->get('craue_config')->get('import_with_redis')) {
+ $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v2'));
+ }
+
+ return $service;
}
/**
- * @Route("/wallabag-v2", name="import_wallabag_v2")
+ * {@inheritdoc}
*/
- public function indexAction(Request $request)
+ protected function getImportTemplate()
{
- return parent::indexAction($request);
+ return 'WallabagImportBundle:WallabagV2:index.html.twig';
}
}