Fix get.php key loading fallback

This commit is contained in:
Hamza-Ayed
2026-07-22 04:03:37 +03:00
parent a2f0911d13
commit 6282be37d8
+3 -2
View File
@@ -32,8 +32,9 @@ try {
// 2. طلب بيانات السائقين من سيرفر اللوكيشن (Redis API)
// — يرجع cache hits لو موجودة، وإلا يرجع IDs فقط
// ==========================================
$locationServerUrl = getenv('LOCATION_API_URL');
$INTERNAL_KEY = trim(file_get_contents(getenv('INTERNAL_SOCKET_KEY_PATH')));
$locationServerUrl = getenv('LOCATION_API_URL') ?: 'http://nginx/loction_server/api_get_nearby.php';
$keyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '/keys/.internal_socket_key';
$INTERNAL_KEY = getenv('INTERNAL_SOCKET_KEY') ?: (file_exists($keyPath) ? trim((string)@file_get_contents($keyPath)) : (file_exists('/home/location/.internal_socket_key') ? trim((string)@file_get_contents('/home/location/.internal_socket_key')) : ''));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $locationServerUrl);