forked from wallabag/wallabag
Convert other imports to Rabbit
This commit is contained in:
@ -21,7 +21,7 @@ class PocketController extends Controller
|
||||
$pocket->setUser($this->getUser());
|
||||
|
||||
if ($this->get('craue_config')->get('rabbitmq')) {
|
||||
$pocket->setRabbitmqProducer($this->get('old_sound_rabbit_mq.wallabag_pocket_producer'));
|
||||
$pocket->setRabbitmqProducer($this->get('old_sound_rabbit_mq.import_pocket_producer'));
|
||||
}
|
||||
|
||||
return $pocket;
|
||||
|
||||
@ -18,6 +18,11 @@ class ReadabilityController extends Controller
|
||||
$form->handleRequest($request);
|
||||
|
||||
$readability = $this->get('wallabag_import.readability.import');
|
||||
$readability->setUser($this->getUser());
|
||||
|
||||
if ($this->get('craue_config')->get('rabbitmq')) {
|
||||
$readability->setRabbitmqProducer($this->get('old_sound_rabbit_mq.import_readability_producer'));
|
||||
}
|
||||
|
||||
if ($form->isValid()) {
|
||||
$file = $form->get('file')->getData();
|
||||
@ -26,7 +31,6 @@ class ReadabilityController extends Controller
|
||||
|
||||
if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
$res = $readability
|
||||
->setUser($this->getUser())
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -38,6 +38,7 @@ abstract class WallabagController extends Controller
|
||||
$form->handleRequest($request);
|
||||
|
||||
$wallabag = $this->getImportService();
|
||||
$wallabag->setUser($this->getUser());
|
||||
|
||||
if ($form->isValid()) {
|
||||
$file = $form->get('file')->getData();
|
||||
@ -46,7 +47,6 @@ abstract class WallabagController extends Controller
|
||||
|
||||
if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
$res = $wallabag
|
||||
->setUser($this->getUser())
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -12,7 +12,13 @@ class WallabagV1Controller extends WallabagController
|
||||
*/
|
||||
protected function getImportService()
|
||||
{
|
||||
return $this->get('wallabag_import.wallabag_v1.import');
|
||||
$service = $this->get('wallabag_import.wallabag_v1.import');
|
||||
|
||||
if ($this->get('craue_config')->get('rabbitmq')) {
|
||||
$service->setRabbitmqProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
|
||||
}
|
||||
|
||||
return $service;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,13 @@ class WallabagV2Controller extends WallabagController
|
||||
*/
|
||||
protected function getImportService()
|
||||
{
|
||||
return $this->get('wallabag_import.wallabag_v2.import');
|
||||
$service = $this->get('wallabag_import.wallabag_v2.import');
|
||||
|
||||
if ($this->get('craue_config')->get('rabbitmq')) {
|
||||
$service->setRabbitmqProducer($this->get('old_sound_rabbit_mq.import_wallabag_v2_producer'));
|
||||
}
|
||||
|
||||
return $service;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user