2021年3月7日

cache.lua--自带加锁功能方式缓存击穿

摘要: local key = ngx.re.match(ngx.var.request_uri,"/([0-9]+).html") local mlcache = require "resty.mlcache" local function fetch_shop(aaa) ngx.log(ngx.ERR, 阅读全文

posted @ 2021-03-07 18:46 木林coder 阅读(150) 评论(0) 推荐(0) 编辑

lua-resty-mlcache

摘要: opm search mlcache opm --install-dir=/usr/local/openresty/lualib/project/common/mlcache/ get thibaultcha/lua-resty-mlcache 阅读全文

posted @ 2021-03-07 18:44 木林coder 阅读(315) 评论(0) 推荐(0) 编辑

aapplication.lua

摘要: -- ngx.header_content_type='text/plain' --ngx.say(123) local ngx_re_split=require("ngx.re").split local ip_addr = ngx.shared.redis_cluster_addr:get('r 阅读全文

posted @ 2021-03-07 15:42 木林coder 阅读(83) 评论(0) 推荐(0) 编辑

init.lua

摘要: local delay = 5 local handler handler = function (premature) --ngx.log(ngx.ERR," timer-do") local resty_consul = require('resty.consul') local consul 阅读全文

posted @ 2021-03-07 15:41 木林coder 阅读(547) 评论(0) 推荐(0) 编辑

lock.lua

摘要: local rety_lock = require "resty.lock" local cache = ngx.shared.my_cache local key = ngx.re.match(ngx.var.request_uri,"/([0-9]+).html") if type(key) = 阅读全文

posted @ 2021-03-07 15:40 木林coder 阅读(184) 评论(0) 推荐(0) 编辑

导航