Modify to use the redis client provider to connect to redis. #216
This commit is contained in:
parent
740110b42f
commit
89cb5ac27e
1 changed files with 2 additions and 7 deletions
|
|
@ -8,8 +8,6 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
|
||||
use CrEOF\Spatial\PHP\Types\Geometry\Point;
|
||||
|
||||
use Predis\Client as PredisClient;
|
||||
|
||||
class RiderTracker
|
||||
{
|
||||
const RIDER_PREFIX_KEY = 'rider.location';
|
||||
|
|
@ -17,13 +15,10 @@ class RiderTracker
|
|||
protected $em;
|
||||
protected $redis;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
public function __construct(EntityManagerInterface $em, RedisClientProvider $redis_client)
|
||||
{
|
||||
$this->em = $em;
|
||||
|
||||
// TODO: make it read redis settings from config
|
||||
// build a service maybe?
|
||||
$this->redis = new PredisClient();
|
||||
$this->redis = $redis_client->getRedisClient();
|
||||
}
|
||||
|
||||
protected function getRiderKey($rider_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue