- Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
hi,agentzh
I used lock:lock on init_worker_by_lua_file,but inoperative.
here is my code
`local resty_lock = require "resty.lock"
local lockOpts = {["exptime"]="5",["timeout"]="0"}
local lock, err = resty_lock:new("MY_LOCKS",lockOpts)
if not lock then
ngx.log(ngx.ERR,"failed to create lock:"..tostring(err))
return
end
local elapsed, err = lock:lock('lock_key')
if not elapsed then
ngx.log(ngx.DEBUG,"failed to acquire the lock: "..tostring(err))
return
else
ngx.log(ngx.DEBUG,"get lock success")
return
end
)`
My nginx has 4 workers and i set timeout=0 for get lock operation,but still display 4 'get lock success'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels