Skip to content

Commit

Permalink
fix mnsJob queue bug
Browse files Browse the repository at this point in the history
  • Loading branch information
milkmeowo committed Jan 23, 2019
1 parent 26da3ad commit 2b04156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Jobs/MnsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MnsJob extends Job implements JobContract
public function __construct(Container $container, MnsAdapter $mns, $queue, ReceiveMessageResponse $job)
{
$this->container = $container;
$this->mns = $mns->useQueue($queue);
$this->mns = $mns;
$this->queue = $queue;
$this->job = $job;
}
Expand All @@ -69,7 +69,7 @@ public function delete()
{
try {
$receiptHandle = $this->job->getReceiptHandle();
$this->mns->deleteMessage($receiptHandle);
$this->mns->useQueue($this->queue)->deleteMessage($receiptHandle);
// 删除成功
$this->deleted = true;
} catch (MnsException $exception) {
Expand All @@ -92,7 +92,7 @@ public function release($delay = 0)
$delay = $this->fromNowToNextVisibleTime($this->job->getNextVisibleTime());
}
parent::release($delay);
$this->mns->changeMessageVisibility($this->job->getReceiptHandle(), $delay);
$this->mns->useQueue($this->queue)->changeMessageVisibility($this->job->getReceiptHandle(), $delay);
}

/**
Expand Down

0 comments on commit 2b04156

Please sign in to comment.