我在laravel 5.1应用程序中创建了一个新工作,运行在Homestead VM中.我已将其设置为排队,并在handle方法中包含代码.
前面的Handle()方法希望传递一个参数,但现在不再需要了,我已经从Handle方法中删除了该参数.
但是,当队列运行作业(job)时,我收到错误消息:
[2015-06-17 14:08:46] local.ERROR: exception 'ErrorException' with message 'Missing argument 1 for Simile\Jobs\SpecialJob::handle()' in /home/vagrant/Code/BitBucket/simile-app/app/Jobs/SpecialJob.php:31
该文件的第31行是:
public function handle()
它不再需要任何参数,除非有一个未记录的默认参数.
Now ANY changes I make, including comments out ALL content in the Job file are not seen when I run the queue. I will still get the same error.
Ive tried restarting nginx
, php5-fpm
, supervisor
, beanstalkd
, and running: artisan cache:clear
, artisan clear-compiled
, artisan optimize
, composer dumpautoload
.
毫无办法.
让laravel看到作业(job)文件更新的唯一方法是重启VM.vagrant halt
,然后是vagrant up
.
作业(job)在控制台命令中触发,如下所示:
$this->dispatch(new SpecialJob($site->id));
Here is the full code of the SpecialJob.php
file:
I tried created another new Job and tested, I get the same result.
所有其他非作业(job)文件都会立即更新,没有问题.这只是作业(job)文件.就像一份旧拷贝被缓存在我找不到的地方.