报错信息:
添加一个队列
$job = (new SaveUserAction($new_track,$session))->onQueue('track');
$this->dispatch($job);
报错信息
Method __PHP_Incomplete_Class::handle() does not exist 文件:/data/lcsc-master/v9.1.4/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php 行:135
报错信息: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "App\Jobs\SaveUserAction" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition 文件:/data/lcsc-master/v9.1.4/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php 行:97
解决过程:
停掉队列test队列进程,重新上代码;
删除队列的内容:DEL queue:track
然后重启队列
php artisan queue:restart
启动队列
php artisan queue:work redis --queue=track
amazing !! 没有报错了
原因
旧版本压入队列:
$job = (new SaveUserAction($new_track,$session_id))->onQueue('track');
$this->dispatch($job);
上线前的版本已经压入过该job,但是新版本的压入队列的参数类型不一致,导致反序列化的时候报错