修复初始化加载mysql链接bug
This commit is contained in:
parent
003e4b1915
commit
cf56535678
|
|
@ -259,7 +259,7 @@ def init_with_config():
|
||||||
if config.has_option('rpc', 'host_inner'):
|
if config.has_option('rpc', 'host_inner'):
|
||||||
g_config['rpc_host'] = config.get('rpc', 'host_inner')
|
g_config['rpc_host'] = config.get('rpc', 'host_inner')
|
||||||
if config.has_option('user_dbinfo', 'host_inner'):
|
if config.has_option('user_dbinfo', 'host_inner'):
|
||||||
g_user_db['host'] = config.get('user_db', 'host_inner')
|
g_user_db['host'] = config.get('user_dbinfo', 'host_inner')
|
||||||
if config.has_option('cross_delay_db', 'host_inner'):
|
if config.has_option('cross_delay_db', 'host_inner'):
|
||||||
g_cross_delay_db['host'] = config.get('cross_delay_db', 'host_inner')
|
g_cross_delay_db['host'] = config.get('cross_delay_db', 'host_inner')
|
||||||
print(g_dbinfo)
|
print(g_dbinfo)
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ class TmnetDbHelper(TableDbHelperBase):
|
||||||
left join (select name,crossid, location,nodeid, area_id from `cross_ledger_update_info` where nodeid = %s and area_id = %s and at_edge=0 and isdeleted=0 ) as t2 on t1.crossid=t2.crossid
|
left join (select name,crossid, location,nodeid, area_id from `cross_ledger_update_info` where nodeid = %s and area_id = %s and at_edge=0 and isdeleted=0 ) as t2 on t1.crossid=t2.crossid
|
||||||
""" % (nodeid, area_id, nodeid, area_id)
|
""" % (nodeid, area_id, nodeid, area_id)
|
||||||
cross_list = self.do_select(sql)
|
cross_list = self.do_select(sql)
|
||||||
|
virtual_cross_sql = f'select name, crossid, location, nodeid, area_id from user_defined_cross where nodeid = {nodeid} and area_id = {area_id}'
|
||||||
|
virtual_cross_list = self.do_select(virtual_cross_sql)
|
||||||
|
cross_list.extend(virtual_cross_list)
|
||||||
if area_id != 0:
|
if area_id != 0:
|
||||||
area_cross_sql = f'select * from bound_crosses where nodeid = {nodeid} and area_id = {area_id}'
|
area_cross_sql = f'select * from bound_crosses where nodeid = {nodeid} and area_id = {area_id}'
|
||||||
area_crosses = self.do_select(area_cross_sql)
|
area_crosses = self.do_select(area_cross_sql)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue