|
@@ -1038,15 +1038,28 @@ s.resp.on_recv = function (source, fd, msg_id, msg_body,user_data)
|
|
|
return tools.response(fd,200,string.format("接口 %s 不存在",func))
|
|
|
end
|
|
|
s.init = function()
|
|
|
- db=mysql.connect({
|
|
|
- host=runconfig.db_tost,
|
|
|
- port=runconfig.db_port,
|
|
|
- database=runconfig.db_name,
|
|
|
- user="root",
|
|
|
- password=runconfig.db_pw,
|
|
|
- max_packet_size = 1024 * 1024,
|
|
|
- on_connect = nil
|
|
|
- })
|
|
|
+ if runconfig.is_debug then
|
|
|
+ db=mysql.connect({
|
|
|
+ host=runconfig.db_debug_config.db_tost,
|
|
|
+ port=runconfig.db_debug_config.db_port,
|
|
|
+ database=runconfig.db_debug_config.db_name,
|
|
|
+ user=runconfig.db_debug_config.db_user,
|
|
|
+ password=runconfig.db_debug_config.db_pw,
|
|
|
+ max_packet_size = 1024 * 1024,
|
|
|
+ on_connect = nil
|
|
|
+ })
|
|
|
+ else
|
|
|
+ db=mysql.connect({
|
|
|
+ host=runconfig.db_release_config.db_tost,
|
|
|
+ port=runconfig.db_release_config.db_port,
|
|
|
+ database=runconfig.db_release_config.db_name,
|
|
|
+ user=runconfig.db_release_config.db_user,
|
|
|
+ password=runconfig.db_release_config.db_pw,
|
|
|
+ max_packet_size = 1024 * 1024,
|
|
|
+ on_connect = nil
|
|
|
+ })
|
|
|
+ end
|
|
|
+
|
|
|
if not db then
|
|
|
skynet.error("failed to connect")
|
|
|
skynet.exit()
|