|
@@ -282,29 +282,30 @@ class HttpServerSettelement
|
|
|
unset($order_ids);
|
|
unset($order_ids);
|
|
|
|
|
|
|
|
$redisconfig = $this->redisonfig;
|
|
$redisconfig = $this->redisonfig;
|
|
|
|
|
+ $redis = new \Redis();
|
|
|
foreach ($PageOrder_ids_1 as $p_order_ids) {
|
|
foreach ($PageOrder_ids_1 as $p_order_ids) {
|
|
|
$nowchange_status = ($i == 1) ? $change_status : 0;
|
|
$nowchange_status = ($i == 1) ? $change_status : 0;
|
|
|
$data = json_encode(['ids' => $p_order_ids, 'bettype' => $bettype, 'settype' => $settype, 'game_code' => $game_code, 'match_id' => $match_id, 'change_status' => $nowchange_status], 256);
|
|
$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();
|
|
|
|
|
- $ret = $redis->connect($redisconfig['host'], $redisconfig['port']);
|
|
|
|
|
|
|
+ //go(function () use ($data, $redisconfig) {
|
|
|
|
|
+ // $redis = new Swoole\Coroutine\Redis();
|
|
|
|
|
+ $ret = $redis->connect($redisconfig['host'], $redisconfig['port']);
|
|
|
|
|
+ if (!$ret) {
|
|
|
|
|
+ throw new \Exception('redis 连接失败', 1106);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!empty($redisconfig['passwd'])) {
|
|
|
|
|
+ $ret = $redis->auth($redisconfig['passwd']);
|
|
|
if (!$ret) {
|
|
if (!$ret) {
|
|
|
- throw new \Exception('redis 连接失败', 1106);
|
|
|
|
|
- }
|
|
|
|
|
- if (!empty($redisconfig['passwd'])) {
|
|
|
|
|
- $ret = $redis->auth($redisconfig['passwd']);
|
|
|
|
|
- if (!$ret) {
|
|
|
|
|
- throw new \Exception('redis auth 失败', 1107);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ throw new \Exception('redis auth 失败', 1107);
|
|
|
}
|
|
}
|
|
|
- $redis->select($redisconfig['db']);
|
|
|
|
|
-
|
|
|
|
|
- $redis->lpush(self::TASKQNUM, $data);
|
|
|
|
|
- return;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ $redis->select($redisconfig['db']);
|
|
|
|
|
+ $redis->lpush(self::TASKQNUM, $data);
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // });
|
|
|
unset($data);
|
|
unset($data);
|
|
|
$i++;
|
|
$i++;
|
|
|
}
|
|
}
|
|
|
|
|
+ $redis->close();
|
|
|
|
|
|
|
|
LABRETURN:
|
|
LABRETURN:
|
|
|
$data = Response::generate('', 1, ['cost' => (microtime(true) - $request->server['request_time_float'])], 'succes');
|
|
$data = Response::generate('', 1, ['cost' => (microtime(true) - $request->server['request_time_float'])], 'succes');
|