Update: 2026-07-10 03:04:06
This commit is contained in:
@@ -511,6 +511,24 @@ $io->on('workerStart', function () use ($io, $INTERNAL_KEY) {
|
||||
|
||||
$connection->send('OK');
|
||||
|
||||
// ── 7b. Get Ride State (Redis Cache Read-Only) ─────────
|
||||
// Used by ride_server/intaleq/ride/rides/getRideStatus.php to
|
||||
// answer passenger polling without hitting MySQL on every call.
|
||||
} elseif ($action === 'get_ride_state') {
|
||||
$rideId = (int)($post['ride_id'] ?? 0);
|
||||
|
||||
if ($rideId <= 0 || !$redis) {
|
||||
$connection->send(json_encode(['status' => false, 'data' => null]));
|
||||
return;
|
||||
}
|
||||
|
||||
$stateData = $redis->hgetall("ride:{$rideId}:state");
|
||||
|
||||
$connection->send(json_encode([
|
||||
'status' => !empty($stateData),
|
||||
'data' => $stateData ?: null,
|
||||
]));
|
||||
|
||||
// ── 5. Force Disconnect ───────────────────────────────
|
||||
} elseif ($action === 'force_disconnect') {
|
||||
$driverId = $post['driver_id'] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user