Skip to content

Commit 07d4c39

Browse files
authored
Merge pull request #735 from php-enqueue/fix-job-status-processor
fix job status processor
2 parents 2baccf2 + 345e162 commit 07d4c39

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/job-queue/JobProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ protected function saveJob(Job $job)
260260
*/
261261
protected function sendCalculateRootJobStatusEvent(Job $job)
262262
{
263-
$this->producer->sendEvent(Commands::CALCULATE_ROOT_JOB_STATUS, [
263+
$this->producer->sendCommand(Commands::CALCULATE_ROOT_JOB_STATUS, [
264264
'jobId' => $job->getId(),
265265
]);
266266
}

pkg/job-queue/Tests/JobProcessorTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function testCreateChildJobShouldCreateAndSaveJobAndPublishRecalculateRoo
169169
$producer = $this->createProducerMock();
170170
$producer
171171
->expects($this->once())
172-
->method('sendEvent')
172+
->method('sendCommand')
173173
->with(Commands::CALCULATE_ROOT_JOB_STATUS, ['jobId' => 12345])
174174
;
175175

@@ -246,7 +246,7 @@ public function testStartJobShouldUpdateJobWithRunningStatusAndStartAtTime()
246246
$producer = $this->createProducerMock();
247247
$producer
248248
->expects($this->once())
249-
->method('sendEvent')
249+
->method('sendCommand')
250250
;
251251

252252
$processor = new JobProcessor($storage, $producer);
@@ -316,7 +316,7 @@ public function testSuccessJobShouldUpdateJobWithSuccessStatusAndStopAtTime()
316316
$producer = $this->createProducerMock();
317317
$producer
318318
->expects($this->once())
319-
->method('sendEvent')
319+
->method('sendCommand')
320320
;
321321

322322
$processor = new JobProcessor($storage, $producer);
@@ -386,7 +386,7 @@ public function testFailJobShouldUpdateJobWithFailStatusAndStopAtTime()
386386
$producer = $this->createProducerMock();
387387
$producer
388388
->expects($this->once())
389-
->method('sendEvent')
389+
->method('sendCommand')
390390
;
391391

392392
$processor = new JobProcessor($storage, $producer);
@@ -456,7 +456,7 @@ public function testCancelJobShouldUpdateJobWithCancelStatusAndStoppedAtTimeAndS
456456
$producer = $this->createProducerMock();
457457
$producer
458458
->expects($this->once())
459-
->method('sendEvent')
459+
->method('sendCommand')
460460
;
461461

462462
$processor = new JobProcessor($storage, $producer);

0 commit comments

Comments
 (0)