bungle/lua-resty-session

DSHM useless call to setmetadata when pool is specified

oldium opened this issue · 1 comments

oldium commented

DSHM constructor calls setmetadata when pool value is specified but ignores the result.

See

if pool or pool_size or backlog then
setmetatable({
prefix = prefix,
suffix = suffix,
host = host,
port = port,
connect_timeout = connect_timeout,
send_timeout = send_timeout,
read_timeout = read_timeout,
keepalive_timeout = keepalive_timeout,
ssl = ssl,
ssl_verify = ssl_verify,
server_name = server_name,
options = {
pool = pool,
pool_size = pool_size,
backlog = backlog,
}
}, metatable)
end
return setmetatable({
prefix = prefix,
suffix = suffix,
host = host,
port = port,
connect_timeout = connect_timeout,
send_timeout = send_timeout,
read_timeout = read_timeout,
keepalive_timeout = keepalive_timeout,
ssl = ssl,
ssl_verify = ssl_verify,
server_name = server_name,
}, metatable)
end

bungle commented

good catch! thanks!