From 356b3ad5f9ceacdc187461f3c193bd497ce95730 Mon Sep 17 00:00:00 2001 From: Alexander Kozienko Date: Mon, 21 Jan 2019 13:40:39 +0200 Subject: [PATCH 1/2] fix job status processor --- pkg/job-queue/JobProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(), ]); } From 345e162d24e4b65c725247f5acf973b2f1994924 Mon Sep 17 00:00:00 2001 From: Alexander Kozienko Date: Mon, 21 Jan 2019 14:30:39 +0200 Subject: [PATCH 2/2] fix job status processor --- pkg/job-queue/Tests/JobProcessorTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);