Skip to content

Commit

Permalink
Merge pull request #354 from bashilbers/patch-3
Browse files Browse the repository at this point in the history
hardcoded queue prefix as constant
  • Loading branch information
acrobat committed Feb 13, 2018
2 parents e4ca25a + 0c6cbae commit 1144b4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Driver/PhpRedisDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/
class PhpRedisDriver implements \Bernard\Driver
{
const QUEUE_PREFIX = 'queue:';

protected $redis;

/**
Expand Down Expand Up @@ -42,7 +44,7 @@ public function createQueue($queueName)
*/
public function countMessages($queueName)
{
return $this->redis->lLen('queue:' . $queueName);
return $this->redis->lLen(self::QUEUE_PREFIX . $queueName);
}

/**
Expand Down Expand Up @@ -114,6 +116,6 @@ public function info()
*/
protected function resolveKey($queueName)
{
return 'queue:' . $queueName;
return self::QUEUE_PREFIX . $queueName;
}
}

0 comments on commit 1144b4d

Please sign in to comment.