Authored by zhouxiang

no message

... ... @@ -13,6 +13,10 @@ import java.util.Map;
*/
public class HandlebarsUtils {
private static Handlebars handlebars = new Handlebars();
static {
handlebars.setStartDelimiter("<<<");
handlebars.setEndDelimiter(">>>");
}
public static String replace(Map<String, Object> obj,String tempfilePath,String createFileName) {
String result = "";
... ...
... ... @@ -114,14 +114,14 @@ http
upstream apigateway {
{{#each ips}}server {{this}}:8080 max_fails=5 fail_timeout=3s;
{{/each}}
<<<#each ips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
keepalive 32;
}
upstream grayapigateway {
{{#each grayips}}server {{this}}:8080 max_fails=5 fail_timeout=3s;
{{/each}}
<<<#each grayips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
keepalive 32;
}
... ...
... ... @@ -7,7 +7,7 @@ local context=ngx.lookup_context
context.dns_server={"114.114.114.114"}
-- 1:aws ,2:qq ,3:aws+qq
context.cloud_flag={{flag}}
context.cloud_flag=<<<flag>>>
--add 20160823 notLogin=aws/tencent
context.strategy_param={["model"]=1024,["tencentMax"]=128,["notLogin"]="aws"}
... ...
... ... @@ -112,15 +112,15 @@ http
}
upstream apigateway {
{{#each ips}}server {{this}}:8080 max_fails=5 fail_timeout=3s;
{{/each}}
{{#each ips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
keepalive 32;
}
upstream grayapigateway{
# ip_hash;
{{#each grayips}}server {{this}}:8080 max_fails=5 fail_timeout=3s;
{{/each}}
<<<#each grayips>>>server <<<this>>>:8080 max_fails=5 fail_timeout=3s;
<<</each>>>
keepalive 32;
}
... ...
... ... @@ -65,14 +65,14 @@ public class LuaSwitchCtrl {
*
* @return 2016年5月12日下午1:49:48
*/
@RequestMapping(value = "viewToChangeLuaConf")
@RequestMapping(value = "viewToChangeLuaConf")
@ResponseBody
public BaseResponse viewToChangeLuaConf(String cloudName, HttpServletRequest request) {
logger.info("cloudName {}",cloudName);
Map<String,Object> map = new HashMap();
map.put("flag", StringUtils.equals("aws",cloudName) ? 1 : (StringUtils.equals("qcloud",cloudName) ? 2 : 3));
String path = request.getSession().getServletContext().getRealPath("/") + "lua/dns_resolver_worker.lua";
String result = HandlebarsUtils.replace(map,"dns_resolver_worker",path);
String result = HandlebarsUtils.replace(map,"template/dns_resolver_worker",path);
return new BaseResponse(200,"success",result);
}
... ...