Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel作业批处理:PendingDispatch::u invoke()不存在_Laravel_Laravel Queue - Fatal编程技术网

Laravel作业批处理:PendingDispatch::u invoke()不存在

Laravel作业批处理:PendingDispatch::u invoke()不存在,laravel,laravel-queue,Laravel,Laravel Queue,处理作业批处理时,当它转到下一个作业并完成时,会引发反射异常。你可以在Flare上找到我的 我看过其他关于反射异常的帖子,所以我试过了 重新启动代客泊车 composer更新 composer转储自动加载 使用以下代码分派我的作业: $batch = Bus::batch( $this->sisProvider() ->syncSchools() ->filter(fn (School $school) => $school-&

处理作业批处理时,当它转到下一个作业并完成时,会引发反射异常。你可以在Flare上找到我的

我看过其他关于反射异常的帖子,所以我试过了

  • 重新启动代客泊车
  • composer更新
  • composer转储自动加载
使用以下代码分派我的作业:

$batch = Bus::batch(
    $this->sisProvider()
        ->syncSchools()
        ->filter(fn (School $school) => $school->active)
        ->map(fn (School $school) => SyncSchool::dispatch($school))
)->then(function (Batch $batch) {
    $this->notifySyncEmails(TenantSyncComplete::class);
})->catch(function (Batch $batch, \Throwable $ex) {
    $this->notifySyncEmails(TenantSyncFailed::class);
})->finally(function (Batch $batch) {
    $this->update(['batch_id' => null]);
})->name('Tenant SIS Sync')->dispatch();

问题是批处理是如何生成的。调用
SyncSchool::dispatch($school)
独立地分派该作业,并返回一个
pendingspatch
。因此,批处理中放入了一个
pendingspatch
,而不是我想要的
SyncSchool
工作

将我的地图中的dispatch($school)更改为
new SyncSchool($school)
将正确地将
SyncSchool
作业放入批处理中

第二课:仔细阅读课文