0
나는 Laravel 5.2 응용 프로그램을 가지고 있으며 특정 작업을 수행하기 위해 작업을 사용하고 있습니다. 제 문제는 다른 작업 내에서 작업을 만들고 싶다는 것입니다. 다른 작업 내에서 작업 만들기 Laravel 5.2
이
내 코드입니다 :public function handle(){
if ($rowMatrix == 500) {
$job = (new importExcelInsert($matrixContacts, $matrixDefaultFields, $matrixCustomFields, $this->idCompany))->delay($jobDelay)->onQueue('excelInserts');
$this->dispatch($job);
$this->insertIntoTJobsUserExcel($this->idCompany, $this->idList, $this->contactListState);
$matrixContacts = [];
$matrixDefaultFields = [];
$matrixCustomFields = [];
$rowMatrix = 0;
}
}
이 코드는 내 데이터베이스 (데이터베이스 드라이버) 내부의 일자리를 창출하지만, 페이로드 아무것도 포함하지 않는, 그 값은 0
$this->idCompany //this field is protected could this be the problem?
EDIT1입니다
그래서 문제는 $ matrixContacts var에 있습니다. 아래 내용의 예를 보여주기 위해 질문을 업데이트했습니다.
[3524]=>
array(5) {
[0]=>
object(Webpatser\Uuid\Uuid)#225258 (8) {
["bytes":protected]=>
string(16) "µ╬╩÷OEèe║³An┬¥"
["hex":protected]=>
NULL
["string":protected]=>
string(36) "e6ceca1e-f64f-4512-8a65-bafc416ec2be"
["urn":protected]=>
NULL
["version":protected]=>
NULL
["variant":protected]=>
NULL
["node":protected]=>
NULL
["time":protected]=>
NULL
}
[1]=>
string(1) "1"
[2]=>
string(9) "Importado"
[3]=>
string(34) "email"
[4]=>
string(30) "nC0rI7eaH3TCWlq4tqRTJuNjp1mvew"
}
"DispatchesJobs"특성을 사용하고 있습니까? https://laravel.com/docs/master/queues#pushing-jobs-onto-the-queue – herrjeh42
네, 이걸 가지고 있습니다 -> InteractsWithQueue, SerializesModels, DispatchesJobs; –
코드가 괜찮아 보입니다. 작동해야합니다. 변수 대신 "구체적인 값"을 생성자에 전달하면 어떻게됩니까? 그게 효과가 있니? 독립 실행 형으로 사용하는 경우 "importExcelInsert"작업이 작동합니까? 컨트롤러에서? – herrjeh42