Resolve "Update RiderTracker to use redis client provider" #1064

Merged
korina.cordero merged 1 commit from 216-update-ridertracker-to-use-redis-client-provider into master 2019-05-28 04:48:31 +00:00

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)