Skip to content

Commit 2789548

Browse files
author
Tree
committed
fix ceche select bug
1 parent 4a8c8cc commit 2789548

3 files changed

Lines changed: 1 addition & 8 deletions

File tree

src/Controller.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ protected function echoJson(int $code, string $enmsg, ?string $cnmsg, $data): vo
227227
if (isset($unique_request_id)) {
228228
if (self::$cache_response_func === null)
229229
self::$cache_response_func = function ($unique_request_id, $echo) {
230-
\cache::select(2);
231230
\cache::rPush($unique_request_id, $echo);
232231
\cache::setTimeout($unique_request_id, 300);
233232
};

src/Handler.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ private static function parseRequest(\Swoole\Http\Request $request, \Swoole\Http
230230
$key = 'rand_lock_' . $unique_request_id;
231231
\SysContext::set('unique_request_id', $unique_request_id);
232232
if (\cache::exists($key)) {
233-
\cache::select(2);
234233
try {
235234
$response_string_arr = \cache::blPop($unique_request_id, 1);
236235

@@ -243,10 +242,8 @@ private static function parseRequest(\Swoole\Http\Request $request, \Swoole\Http
243242
} else
244243
$response_string = null;
245244
} catch(\Swango\Cache\RedisErrorException $e) {
246-
\cache::select(1);
247245
throw $e;
248246
}
249-
\cache::select(1);
250247
if (isset($response_string) && is_string($response_string)) {
251248
$response->header('Access-Control-Allow-Headers',
252249
'Rsa-Certificate-Id, Mango-Rsa-Cert, Mango-Request-Rand, Content-Type');

src/TerminalServer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,7 @@ public function getRequestLogSwitchStatus(int $switch): bool {
320320
}
321321
public function notifyLogQueue(bool $force = false) {
322322
if ($force || $this->notify_log_queue_atomic->get() === 0 && $this->notify_log_queue_atomic->add() === 1) {
323-
$redis = \Swango\Cache\RedisPool::pop();
324-
$redis->select(1);
325-
$redis->lPush(self::$log_queue_redis_key, \Swango\Environment::getServiceConfig()->local_ip);
326-
\Swango\Cache\RedisPool::push($redis);
323+
\cache::lPush(self::$log_queue_redis_key, \Swango\Environment::getServiceConfig()->local_ip);
327324
}
328325
}
329326
}

0 commit comments

Comments
 (0)