Open ajayNegiCodes opened 10 months ago
You cannt do that in init_by_lua_block.
You can save your code into a file and then run with resty cmd. In the Lua code, you can save the resource into a file. And then load the resource from the file in the previous step.
This code being executed from the context of
init_by_lua_file
is giving the below error:Looking at this - https://github.com/openresty/lua-resty-redis#limitations
It says:
I want to execute a lua script when the nginx server starts. And usually that's done through
init_by_lua_block
/init_by_lua_file
directives. How can I achieve that purpose here?