vali 6 anni fa
parent
commit
59de04c645
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      datainf/logic/HttpServerSettelement.php

+ 8 - 2
datainf/logic/HttpServerSettelement.php

@@ -234,9 +234,15 @@ class HttpServerSettelement
                 $data = json_encode(['ids' => $p_order_ids, 'bettype' => $bettype, 'settype' => $settype, 'game_code' => $game_code, 'match_id' => $match_id, 'change_status' => $nowchange_status], 256);
                 go(function () use ($data, $redisconfig) {
                     $redis = new Swoole\Coroutine\Redis();
-                    $redis->connect($redisconfig['host'], $redisconfig['port']);
+                    $ret = $redis->connect($redisconfig['host'], $redisconfig['port']);
+                    if (!$ret) {
+                        throw  new \Exception('redis 连接失败');
+                    }
                     if (!empty($redisconfig['passwd'])) {
-                        $redis->auth($redisconfig['passwd']);
+                        $ret = $redis->auth($redisconfig['passwd']);
+                        if (!$ret) {
+                            throw  new \Exception('redis auth 失败');
+                        }
                     }
                     $redis->select($redisconfig['db']);