diff --git a/README.md b/README.md index 67ba33a..2b3afb2 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ use Resque\Resque; use Predis\Client; $resque = new Resque(new Client()); -$resque->enqueue('default_queue', 'App\Job', array('foo' => 'bar'), true); +$resque->enqueue('default_queue', \App\Job::class, array('foo' => 'bar'), true); ``` In order the arguments are: queue, job class, job payload, whether to enable tracking. diff --git a/src/Console/EnqueueCommand.php b/src/Console/EnqueueCommand.php index 18a13d0..8c38cbb 100644 --- a/src/Console/EnqueueCommand.php +++ b/src/Console/EnqueueCommand.php @@ -17,7 +17,7 @@ protected function configure() parent::configure(); $this - ->setName('enqueue') + ->setName('queue:enqueue') ->setDescription('Enqueues a job into a queue') ->addArgument( 'queue', @@ -49,6 +49,9 @@ protected function configure() InputOption::VALUE_NONE, 'If present, the job will be tracked' ); + + // Add old command name as alias + $this->setAliases(['enqueue']); } /** diff --git a/src/Console/WorkerCommand.php b/src/Console/WorkerCommand.php index 9268103..172c829 100644 --- a/src/Console/WorkerCommand.php +++ b/src/Console/WorkerCommand.php @@ -17,7 +17,7 @@ protected function configure() parent::configure(); $this - ->setName('worker') + ->setName('queue:worker') ->setDescription('Runs a Resque worker') ->addOption( 'queue', @@ -32,6 +32,9 @@ protected function configure() 'Interval in seconds to wait for between reserving jobs', 5 ); + + // Add old command name as alias + $this->setAliases(['worker']); } /** diff --git a/src/Worker.php b/src/Worker.php index b96c367..050150b 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -403,6 +403,7 @@ protected function failJob($job, Exception $exception) $queue ); + $this->logger->error($exception->getMessage()); $this->getResque()->getStatistic('failed')->incr(); $this->getStatistic('failed')->incr(); }