diff --git a/pkg/job-queue/JobProcessor.php b/pkg/job-queue/JobProcessor.php index 77c03eefe..8f197f742 100644 --- a/pkg/job-queue/JobProcessor.php +++ b/pkg/job-queue/JobProcessor.php @@ -260,7 +260,7 @@ protected function saveJob(Job $job) */ protected function sendCalculateRootJobStatusEvent(Job $job) { - $this->producer->sendEvent(Commands::CALCULATE_ROOT_JOB_STATUS, [ + $this->producer->sendCommand(Commands::CALCULATE_ROOT_JOB_STATUS, [ 'jobId' => $job->getId(), ]); } diff --git a/pkg/job-queue/Tests/JobProcessorTest.php b/pkg/job-queue/Tests/JobProcessorTest.php index 483e8ef2d..5ee8159a1 100644 --- a/pkg/job-queue/Tests/JobProcessorTest.php +++ b/pkg/job-queue/Tests/JobProcessorTest.php @@ -169,7 +169,7 @@ public function testCreateChildJobShouldCreateAndSaveJobAndPublishRecalculateRoo $producer = $this->createProducerMock(); $producer ->expects($this->once()) - ->method('sendEvent') + ->method('sendCommand') ->with(Commands::CALCULATE_ROOT_JOB_STATUS, ['jobId' => 12345]) ; @@ -246,7 +246,7 @@ public function testStartJobShouldUpdateJobWithRunningStatusAndStartAtTime() $producer = $this->createProducerMock(); $producer ->expects($this->once()) - ->method('sendEvent') + ->method('sendCommand') ; $processor = new JobProcessor($storage, $producer); @@ -316,7 +316,7 @@ public function testSuccessJobShouldUpdateJobWithSuccessStatusAndStopAtTime() $producer = $this->createProducerMock(); $producer ->expects($this->once()) - ->method('sendEvent') + ->method('sendCommand') ; $processor = new JobProcessor($storage, $producer); @@ -386,7 +386,7 @@ public function testFailJobShouldUpdateJobWithFailStatusAndStopAtTime() $producer = $this->createProducerMock(); $producer ->expects($this->once()) - ->method('sendEvent') + ->method('sendCommand') ; $processor = new JobProcessor($storage, $producer); @@ -456,7 +456,7 @@ public function testCancelJobShouldUpdateJobWithCancelStatusAndStoppedAtTimeAndS $producer = $this->createProducerMock(); $producer ->expects($this->once()) - ->method('sendEvent') + ->method('sendCommand') ; $processor = new JobProcessor($storage, $producer);