Modify to use the redis client provider to connect to redis. #216

This commit is contained in:
Korina Cordero 2019-05-28 04:47:35 +00:00
parent 740110b42f
commit 89cb5ac27e

View file

@ -8,8 +8,6 @@ use Doctrine\ORM\EntityManagerInterface;
use CrEOF\Spatial\PHP\Types\Geometry\Point; use CrEOF\Spatial\PHP\Types\Geometry\Point;
use Predis\Client as PredisClient;
class RiderTracker class RiderTracker
{ {
const RIDER_PREFIX_KEY = 'rider.location'; const RIDER_PREFIX_KEY = 'rider.location';
@ -17,13 +15,10 @@ class RiderTracker
protected $em; protected $em;
protected $redis; protected $redis;
public function __construct(EntityManagerInterface $em) public function __construct(EntityManagerInterface $em, RedisClientProvider $redis_client)
{ {
$this->em = $em; $this->em = $em;
$this->redis = $redis_client->getRedisClient();
// TODO: make it read redis settings from config
// build a service maybe?
$this->redis = new PredisClient();
} }
protected function getRiderKey($rider_id) protected function getRiderKey($rider_id)