By default the underlying ngx_lua module does error logging when socket errors happen. If you are already doing proper error handling in your own Lua code, then you are recommended to disable this automatic error logging by turning off ngx_lua's lua_socket_log_errors directive, that is,
lua_socket_log_errors off;Hi,
是跑在 init_by_worker 这个生命周期里的
但是目前来看,还是有 timeout 超时
发件人:
"open...@googlegroups.com" <open...@googlegroups.com>
代表
朱大仙儿 <zhuho...@tvmining.com>
答复:
"open...@googlegroups.com" <open...@googlegroups.com>
日期:
2018年12月12日
星期三
上午11:29
收件人:
openresty <open...@googlegroups.com>
主题:
Re:[openresty] Re:
如何关掉 redis
里的 timeout
哦,不,我是用了一个协程来进行处理的
类似代码如下:
function M:subscribe(key,func)
local co = coroutine.create(function()
local red = get_con(self)
local ok,err = red:subscribe(key,guid())
if not ok then
return err
end
local flag = true
while flag do
local res,err = red:read_reply()
if err then
;
else
if res[1] == "message" then
local obj = cjson.decode(res[3])
flag = func(obj.msg)
end
end
end
end)
coroutine.resume(co)
end
发件人:
"open...@googlegroups.com" <open...@googlegroups.com>
代表 tokers <zcha...@gmail.com>
答复:
"open...@googlegroups.com" <open...@googlegroups.com>
日期:
2018年12月12日
星期三
下午1:41
收件人:
openresty <open...@googlegroups.com>
主题:
Re: [openresty] Re:
如何关掉 redis
里的 timeout
Hello!
--
--
这个是当 redis 里面有事件时就调用了啊。。。。
发件人:
"open...@googlegroups.com" <open...@googlegroups.com>
代表
朱大仙儿 <zhuho...@tvmining.com>
答复:
"open...@googlegroups.com" <open...@googlegroups.com>
日期:
2018年12月12日
星期三
下午2:10
我直接在init-by-worker 里启动这个协程的
不需要有外部服务触发
发件人:
"open...@googlegroups.com" <open...@googlegroups.com>
代表
朱大仙儿 <zhuho...@tvmining.com>
答复:
"open...@googlegroups.com" <open...@googlegroups.com>
日期:
2018年12月12日
星期三
下午2:39
目前 这个 超时还是关不掉。。。
发件人:
"open...@googlegroups.com" <open...@googlegroups.com>
代表
朱大仙儿 <zhuho...@tvmining.com>
答复:
"open...@googlegroups.com" <open...@googlegroups.com>
日期:
2018年12月12日
星期三
下午2:39