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 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)