123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- local code = require "code"
- local nodeUtil = require("utils.nodeUtil")
- local root = {}
- -- 通过web更新配置
- function root.update_config(query)
- os.execute("sh ../shell/service.sh git config")
- log.info("通过web更新配置")
- local ok = nodeUtil:call_to_node("master", ".srvNodeMgr", "update_node_config")
- if not ok then
- return code.INNER_SERVER_ERROR, "热更新失败"
- end
- return code.OK, "热更配置成功"
- end
- -- 通过web更新逻辑
- function root.update_logic()
- os.execute("sh ../shell/service.sh git logic")
- local ok = nodeUtil:call_to_node("master", ".srvNodeMgr", "update_node_logic")
- if not ok then
- return code.INNER_SERVER_ERROR, "热更新失败"
- end
- return code.OK, "热更逻辑成功"
- end
- -- 通过web更新协议
- function root.update_proto()
- os.execute("sh ../shell/service.sh git proto")
- local ok = nodeUtil:call_to_node("master", ".srvNodeMgr", "update_node_proto")
- if not ok then
- return code.INNER_SERVER_ERROR, "热更新失败"
- end
- return code.OK, "热更协议成功"
- end
- -- 更新所有
- function root.update()
- os.execute("sh ../shell/service.sh git all")
- local ok = nodeUtil:call_to_node("master", ".srvNodeMgr", "update_node")
- if not ok then
- return code.INNER_SERVER_ERROR, "热更新失败"
- end
- return code.OK, "热更所有成功"
- end
- return root
|