Update: 2026-07-22 00:46:37
This commit is contained in:
@@ -26,13 +26,14 @@ if (!$lat || !$lng) {
|
||||
echo json_encode(['status' => false, 'msg' => 'Invalid Coordinates']); exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$redis = new Client(['scheme'=>'tcp',
|
||||
'host'=>'127.0.0.1',
|
||||
'password' => $PASS_REDIS,
|
||||
'port'=>6379,
|
||||
'database' => 0]
|
||||
);
|
||||
$redisHost = getenv('REDIS_HOST') ?: ($_ENV['REDIS_HOST'] ?? (file_exists('/.dockerenv') ? 'redis' : '127.0.0.1'));
|
||||
$redis = new Client([
|
||||
'scheme' => 'tcp',
|
||||
'host' => $redisHost,
|
||||
'password' => $PASS_REDIS,
|
||||
'port' => 6379,
|
||||
'database' => 0
|
||||
]);
|
||||
$redis->connect();
|
||||
|
||||
// 🔥 التعديل هنا: إضافة WITHCOORD لجلب الإحداثيات من الريدز مباشرة
|
||||
|
||||
@@ -101,10 +101,11 @@ function getRedis(): ?RedisClient {
|
||||
}
|
||||
|
||||
try {
|
||||
$redisHost = getenv('REDIS_HOST') ?: ($_ENV['REDIS_HOST'] ?? (file_exists('/.dockerenv') ? 'redis' : '127.0.0.1'));
|
||||
$client = new RedisClient([
|
||||
'scheme' => 'tcp',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'host' => $redisHost,
|
||||
'port' => (int)(getenv('REDIS_PORT') ?: 6379),
|
||||
'password' => $redisPass,
|
||||
'read_write_timeout' => 0,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user