Skip to content

Commit 8a5165f

Browse files
authored
Merge PR #18 and #17 (#19)
* fixes cache key naming (#18) * replace queueUrl to queue (#17)
1 parent e4c6bce commit 8a5165f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/Command/RestartCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4747
{
4848
if ($this->cache !== null) {
4949

50-
$this->cache->set('ideasbucket_queue:restart', time());
50+
$this->cache->set('ideasbucket_queue_restart', time());
5151
$output->writeln('Broadcasting queue restart signal.');
5252

5353
} else {

src/Job/SqsJob.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,20 @@ class SqsJob extends AbstractJob implements JobsInterface
2626
*/
2727
protected $jobData;
2828

29-
/**
30-
* @var string
31-
*/
32-
protected $queueUrl;
33-
3429
/**
3530
* Create a new job instance.
3631
*
3732
* @param ContainerInterface $container
3833
* @param \Aws\Sqs\SqsClient $sqs
3934
* @param array $jobData
4035
* @param string $connectionName
41-
* @param string $queueUrl
36+
* @param string $queue
4237
*/
43-
public function __construct(ContainerInterface $container, SqsClient $sqs, array $jobData, $connectionName, $queueUrl)
38+
public function __construct(ContainerInterface $container, SqsClient $sqs, array $jobData, $connectionName, $queue)
4439
{
4540
$this->sqs = $sqs;
4641
$this->jobData = $jobData;
47-
$this->queueUrl = $queueUrl;
42+
$this->queue = $queue;
4843
$this->container = $container;
4944
$this->connectionName = $connectionName;
5045
}
@@ -59,7 +54,7 @@ public function release($delay = 0)
5954
parent::release($delay);
6055

6156
$this->sqs->changeMessageVisibility([
62-
'QueueUrl' => $this->queueUrl,
57+
'QueueUrl' => $this->queue,
6358
'ReceiptHandle' => $this->jobData['ReceiptHandle'],
6459
'VisibilityTimeout' => $delay,
6560
]);
@@ -72,7 +67,7 @@ public function delete()
7267
{
7368
parent::delete();
7469

75-
$this->sqs->deleteMessage(['QueueUrl' => $this->queueUrl, 'ReceiptHandle' => $this->jobData['ReceiptHandle']]);
70+
$this->sqs->deleteMessage(['QueueUrl' => $this->queue, 'ReceiptHandle' => $this->jobData['ReceiptHandle']]);
7671
}
7772

7873
/**

src/Worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ protected function getTimestampOfLastQueueRestart()
535535
{
536536
if ($this->cache) {
537537

538-
return $this->cache->get('ideasbucket_queue:restart');
538+
return $this->cache->get('ideasbucket_queue_restart');
539539
}
540540
}
541541

0 commit comments

Comments
 (0)