From 7e3bcfe50cc4fb5eb5cd55f05cd1f075f4fc0326 Mon Sep 17 00:00:00 2001 From: Jayin Taung Date: Wed, 1 Jun 2022 17:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Sync=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E5=AE=9E=E4=BE=8B=E5=8C=96Job=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JobProcessing、JobProcessed、JobFailed 实例化时参数`$job`需要类型`think\queue\Job`,而目前类型是任务类的本身 --- src/queue/connector/Sync.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/queue/connector/Sync.php b/src/queue/connector/Sync.php index 3f4d420..3f55f6c 100644 --- a/src/queue/connector/Sync.php +++ b/src/queue/connector/Sync.php @@ -32,14 +32,14 @@ public function push($job, $data = '', $queue = null) $queueJob = $this->resolveJob($this->createPayload($job, $data), $queue); try { - $this->triggerEvent(new JobProcessing($this->connection, $job)); + $this->triggerEvent(new JobProcessing($this->connection, $queueJob)); $queueJob->fire(); - $this->triggerEvent(new JobProcessed($this->connection, $job)); + $this->triggerEvent(new JobProcessed($this->connection, $queueJob)); } catch (Exception | Throwable $e) { - $this->triggerEvent(new JobFailed($this->connection, $job, $e)); + $this->triggerEvent(new JobFailed($this->connection, $queueJob, $e)); throw $e; }