From 544f687cf42993e07cb8dd2aef4fe258d81c95b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Wed, 11 Sep 2019 11:42:52 +0200 Subject: [PATCH] Fixes the queue listen command. We might need to rectify this implementation before stable. --- src/Queue/Console/ListenCommand.php | 15 +++++++++++++++ src/Queue/Listener.php | 15 +++++++++++++++ src/Queue/QueueServiceProvider.php | 8 +++++--- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 src/Queue/Console/ListenCommand.php create mode 100644 src/Queue/Listener.php diff --git a/src/Queue/Console/ListenCommand.php b/src/Queue/Console/ListenCommand.php new file mode 100644 index 000000000..69b23713c --- /dev/null +++ b/src/Queue/Console/ListenCommand.php @@ -0,0 +1,15 @@ +addOption('env'); + } +} diff --git a/src/Queue/Listener.php b/src/Queue/Listener.php new file mode 100644 index 000000000..3a16612b9 --- /dev/null +++ b/src/Queue/Listener.php @@ -0,0 +1,15 @@ +environment = null; + + return $command; + } +} diff --git a/src/Queue/QueueServiceProvider.php b/src/Queue/QueueServiceProvider.php index acaa39abb..2701fd175 100644 --- a/src/Queue/QueueServiceProvider.php +++ b/src/Queue/QueueServiceProvider.php @@ -18,8 +18,8 @@ use Illuminate\Contracts\Queue\Factory; use Illuminate\Queue\Connectors\ConnectorInterface; use Illuminate\Queue\Console as Commands; use Illuminate\Queue\Failed\NullFailedJobProvider; -use Illuminate\Queue\Listener; use Illuminate\Queue\SyncQueue; +use Illuminate\Queue\Listener as QueueListener; use Illuminate\Queue\Worker; class QueueServiceProvider extends AbstractServiceProvider @@ -27,7 +27,7 @@ class QueueServiceProvider extends AbstractServiceProvider protected $commands = [ Commands\FlushFailedCommand::class, Commands\ForgetFailedCommand::class, -// Commands\ListenCommand::class, + Console\ListenCommand::class, Commands\ListFailedCommand::class, // Commands\RestartCommand::class, Commands\RetryCommand::class, @@ -36,6 +36,8 @@ class QueueServiceProvider extends AbstractServiceProvider public function register() { + define('ARTISAN_BINARY', 'flarum'); + // Register a simple connection factory that always returns the same // connection, as that is enough for our purposes. $this->app->singleton(Factory::class, function () { @@ -65,7 +67,7 @@ class QueueServiceProvider extends AbstractServiceProvider ); }); - $this->app->singleton(Listener::class, function ($app) { + $this->app->singleton(QueueListener::class, function ($app) { return new Listener($app->basePath()); });