0
連接Tarantool我想創建init_by_lua_block
或init_worker_by_lua_block
連接Tarantool數據庫,然後用在每個content_by_lua_block
創建連接:Openresty:創建初始化
init_by_lua_block {
local tnt = require 'resty.tarantool'
local tar, err = tnt:new({
host = '127.0.0.1',
port = 3312,
user = 'user',
password = 'password',
socket_timeout = 2000
})
local res, err = tar:connect()
}
但cosocket API中的指令init_*_by_lua*
被禁用。我如何創建連接而不是爲每個請求創建連接?