Update: 2026-08-01 18:37:02

This commit is contained in:
Hamza-Ayed
2026-08-01 18:37:02 +03:00
parent f7df080b27
commit b30fe7e96d
4 changed files with 25 additions and 1 deletions
+4
View File
@@ -368,8 +368,10 @@ $io->on('workerStart', function () use ($io, $INTERNAL_KEY) {
if ($st === 'off') {
$pipe->geoadd('geo:drivers:available', $lng, $lat, $driverId);
logMsg("[REDIS BATCH] Added Driver $driverId to geo:drivers:available at $lat, $lng");
} elseif ($st === 'on') {
$pipe->geoadd('geo:drivers:busy', $lng, $lat, $driverId);
logMsg("[REDIS BATCH] Added Driver $driverId to geo:drivers:busy at $lat, $lng");
}
}
}
@@ -876,6 +878,8 @@ $io->on('connection', function ($socket) use ($INTERNAL_KEY) {
$state = &$driverState[$driverId];
$now = time();
logMsg("[SOCKET] update_location received for Driver $driverId | status=$status, lat=$lat, lng=$lng");
// 1. Forward للراكب (ASYNC + throttle)
if (!empty($passengerId)) {