diff --git a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php index 6441bf41..5f33261b 100644 --- a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php +++ b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php @@ -215,7 +215,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface $rider_id = $rider->getID(); // cache rider location (default to hub) // TODO: figure out longitude / latitude default - $this->rcache->addActiveRider($rider_id, 0, 0); + // $this->rcache->addActiveRider($rider_id, 0, 0); // TODO: log rider logging in @@ -285,7 +285,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface $rider->setActive(false); // remove from cache - $this->rcache->removeActiveRider($rider->getID()); + // $this->rcache->removeActiveRider($rider->getID()); // remove rider from session $this->session->setRider(null); @@ -318,6 +318,10 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface $this->em->flush(); + // cache rider location (default to hub) + // TODO: figure out longitude / latitude default + $this->rcache->addActiveRider($rider_id, 0, 0); + // send mqtt event to put rider on map // get rider coordinates from redis $coord = $this->rider_tracker->getRiderLocation($rider->getID()); @@ -367,6 +371,9 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface $this->em->flush(); + // remove from cache + $this->rcache->removeActiveRider($rider->getID()); + // send mqtt event to remove rider from map $channel = 'rider/' . $rider->getID() . '/availability'; $payload = [