diff --git a/src/Service/RiderTracker.php b/src/Service/RiderTracker.php index c34d215d..1e377ec7 100644 --- a/src/Service/RiderTracker.php +++ b/src/Service/RiderTracker.php @@ -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)