Update: 2026-07-22 16:01:21
This commit is contained in:
@@ -37,7 +37,7 @@ if (!empty($INTERNAL_KEY) && $receivedKey !== $INTERNAL_KEY) {
|
||||
|
||||
$lat = $_REQUEST['lat'] ?? null;
|
||||
$lng = $_REQUEST['lng'] ?? null;
|
||||
$radius = $_REQUEST['radius'] ?? 25;
|
||||
$radius = $_REQUEST['radius'] ?? 5;
|
||||
$limit = $_REQUEST['limit'] ?? 100;
|
||||
|
||||
if (!$lat || !$lng) {
|
||||
@@ -67,7 +67,7 @@ try {
|
||||
|
||||
$validDrivers = [];
|
||||
$currentTime = time();
|
||||
$max_silence = 900; // 15 دقيقة سماحية للسائق المنتظر في مكانه
|
||||
$max_silence = 180;
|
||||
|
||||
foreach ($geoResults as $res) {
|
||||
// هيكل النتيجة مع WITHCOORD يختلف قليلاً
|
||||
@@ -76,9 +76,9 @@ try {
|
||||
$d_coord= $res[2]; // [0=>lng, 1=>lat] 🔥 الإحداثيات هنا
|
||||
|
||||
$profile = $redis->hgetall("driver:profile:$d_id");
|
||||
$lastUpdate = isset($profile['updated_at']) ? (int)$profile['updated_at'] : $currentTime;
|
||||
$lastUpdate = isset($profile['updated_at']) ? (int)$profile['updated_at'] : 0;
|
||||
|
||||
if (!empty($lastUpdate) && ($currentTime - $lastUpdate) > $max_silence) {
|
||||
if (empty($profile) || ($currentTime - $lastUpdate) > $max_silence) {
|
||||
$redis->zrem('geo:drivers:available', $d_id);
|
||||
$redis->zrem('geo:drivers:busy', $d_id);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user