This commit is contained in:
hujiabin 2022-11-16 20:02:05 +08:00
parent 980ac0ca85
commit c251a6bbce
2 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,7 @@
$g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.php'); $g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.php');
$g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php'); $g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php');
$g_conf_relation_mysql_cluster = require('../config/game2006relation.mysql.cluster.php');
$g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php'); $g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php');
$g_metatables = array(); $g_metatables = array();
@ -52,6 +53,16 @@ function getMarketMysqlConfig($hash_value)
return $g_conf_market_mysql_cluster; return $g_conf_market_mysql_cluster;
} }
function getRelationMysqlConfig($hash_value)
{
if ($hash_value < 0) {
error_log('callstack:' . json_encode(debug_backtrace(), JSON_PRETTY_PRINT));
die('hash_value < 0 ' . $hash_value);
}
global $g_conf_relation_mysql_cluster;
return $g_conf_relation_mysql_cluster;
}
function getRedisConfig($hash_value) function getRedisConfig($hash_value)
{ {
if ($hash_value < 0) { if ($hash_value < 0) {

View File

@ -130,7 +130,7 @@ class BaseController {
if ($this->relationDbConn) { if ($this->relationDbConn) {
return $this->relationDbConn; return $this->relationDbConn;
} }
$mysql_conf = getMarketMysqlConfig(crc32('')); $mysql_conf = getRelationMysqlConfig(crc32(''));
$this->relationDbConn = new phpcommon\Mysql(array( $this->relationDbConn = new phpcommon\Mysql(array(
'host' => $mysql_conf['host'], 'host' => $mysql_conf['host'],
'port' => $mysql_conf['port'], 'port' => $mysql_conf['port'],