Php Larvel队列';关闭';不允许
我已经试过解决问题,但最终,他们没有解决我的问题 我将作业添加到队列中,如下所示 还有我的工作Php Larvel队列';关闭';不允许,php,laravel,laravel-5,queue,Php,Laravel,Laravel 5,Queue,我已经试过解决问题,但最终,他们没有解决我的问题 我将作业添加到队列中,如下所示 还有我的工作 class RestoreApplicationJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $datas; public $tries = 1; public function __construct($datas) {
class RestoreApplicationJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $datas;
public $tries = 1;
public function __construct($datas)
{
$this->datas = $datas;
}
public function handle()
{
try{
$application = $this->datas['application'];
$notification = $this->datas['notification'];
$application->activate();
$tmp_data = $notification->data;
$tmp_data['state'] = Opertation::SUCCESS;
$notification->data = $tmp_data;
$notification->save();
}catch(\Exception $e)
{
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
$tmp_data = $notification->data;
$tmp_data['state'] = Opertation::FAILED;
$notification->data = $tmp_data;
$notification->save();
}
}
}
我有一个错误:
不允许对“Closure”进行序列化
我检查了很多次,但什么也没找到
谢谢你的帮助,很抱歉我的英语这么差:) 我的问题太疯狂了 这只是我调用类
Operation
instand的Operation
内部作业。
那个抛出异常
class RestoreApplicationJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $datas;
public $tries = 1;
public function __construct($datas)
{
$this->datas = $datas;
}
public function handle()
{
try{
$application = $this->datas['application'];
$notification = $this->datas['notification'];
$application->activate();
$tmp_data = $notification->data;
$tmp_data['state'] = Opertation::SUCCESS;
$notification->data = $tmp_data;
$notification->save();
}catch(\Exception $e)
{
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
$tmp_data = $notification->data;
$tmp_data['state'] = Opertation::FAILED;
$notification->data = $tmp_data;
$notification->save();
}
}