init_lua.hbs 637 Bytes
-- init redis twemproxy config
local redis_config1={host="127.0.0.1",port="6379",auth=nil,timeout=2000,max_idle_timeout=60000,pool_size=1000}

local redis_util=require("redisutil")

local redis1=redis_util:new(redis_config1)


lua_context={}
lua_context["redises"]={redis1}

open_limit_flow={@{open_limit_flow}@}
api_default_max_per_sencond=1000
service_default_max_per_sencond=1000
default_err_code=9999991
default_err_msg="系统正忙,请稍后重试!"
--limit interface
limit_config={
    {@{#each limit_config}@}{@{{this}}@}
    {@{/each}@}
}

limit_service_config={
   {@{#each limit_service_config}@}{@{{this}}@}
   {@{/each}@}
}