19
This commit is contained in:
@@ -22,8 +22,8 @@ $INTERNAL_KEY = trim(file_get_contents(getenv('INTERNAL_SOCKET_KEY_PATH')));
|
||||
|
||||
function sendToLocationServer($action, $data) {
|
||||
// رابط سيرفر اللوكيشن الداخلي أو العام
|
||||
$url = getenv('LOCATION_SOCKET_URL');
|
||||
$INTERNAL_KEY = trim(file_get_contents(getenv('INTERNAL_SOCKET_KEY_PATH')));
|
||||
$url = "http://188.68.36.205:2021";
|
||||
$INTERNAL_KEY = trim((string)@file_get_contents('/home/intaleq-api/.internal_socket_key'));
|
||||
|
||||
$postData = [
|
||||
'action' => $action,
|
||||
@@ -43,8 +43,8 @@ function sendToLocationServer($action, $data) {
|
||||
|
||||
function findBestDrivers($con, $lat, $lng, $carType) {
|
||||
// 1. الاتصال بـ Redis لجلب الأقرب
|
||||
$locationServerUrl = getenv('LOCATION_API_URL');
|
||||
$INTERNAL_KEY = trim(file_get_contents(getenv('INTERNAL_SOCKET_KEY_PATH')));
|
||||
$locationServerUrl = "https://location.intaleq.xyz/api_get_nearby.php";
|
||||
$INTERNAL_KEY = trim((string)@file_get_contents('/home/intaleq-api/.internal_socket_key'));
|
||||
|
||||
$postData = ['lat' => $lat, 'lng' => $lng, 'radius' => 5, 'limit' => 100];
|
||||
|
||||
@@ -242,9 +242,12 @@ function notifyPassengerOnRideServer($passenger_id, $payload) {
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if (curl_errno($ch)) {
|
||||
error_log("Curl Error (Passenger Socket): " . curl_error($ch));
|
||||
error_log("[SOCKET_DEBUG] Curl Error (Passenger Socket) to $url: " . curl_error($ch));
|
||||
} else {
|
||||
error_log("[SOCKET_DEBUG] Sent to Passenger Socket $url | HTTP: $httpCode | Response: $response | Passenger: $passenger_id");
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
@@ -261,11 +264,9 @@ function dispatchRideToDrivers($driversData, $rideId, $payloadTemplate, $startNa
|
||||
$countDrivers = count($driversData);
|
||||
error_log("🚀 [DISPATCH_START] RideID: $rideId | Drivers Count: $countDrivers");
|
||||
|
||||
$socketUrl = getenv('LOCATION_SOCKET_URL');
|
||||
if (!$socketUrl) throw new RuntimeException('LOCATION_SOCKET_URL not configured');
|
||||
|
||||
$internalKeyPath = getenv('INTERNAL_SOCKET_KEY_PATH');
|
||||
$internalKey = file_exists($internalKeyPath) ? trim(file_get_contents($internalKeyPath)) : '';
|
||||
$socketUrl = 'http://188.68.36.205:2021';
|
||||
$internalKeyPath = '/home/intaleq-api/.internal_socket_key';
|
||||
$internalKey = file_exists($internalKeyPath) ? trim((string)@file_get_contents($internalKeyPath)) : '';
|
||||
|
||||
foreach ($driversData as $driver) {
|
||||
$driverId = $driver['driver_id'];
|
||||
|
||||
Reference in New Issue
Block a user