]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
Enable Redis async import
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Controller / WallabagV1Controller.php
index 3e748d57f7da090d2fa8fb76f4d3b2df9739adcc..312c7a357f62781df70f62bb3016f11c8e7601e7 100644 (file)
@@ -12,7 +12,15 @@ 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('import_with_rabbitmq')) {
+            $service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
+        } elseif ($this->get('craue_config')->get('import_with_redis')) {
+            $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
+        }
+
+        return $service;
     }
 
     /**