Open fankeke opened 7 years ago
hello As I see, in init phase, slardar has been declarded as a global variable,
init
slardar
But global variable has side effect in ngx_lua, so why doing this ,any sepecial consideratin for this?
slardar could be declarded as a module level variable that could achieve the same goal .
--init.lua
local slardar = require "config"
slarder.kk= "any operation you want"
--foo.lua local slarder = require "config" --has been cached by package.loader --you can use slader.kk here
thanks .
hello As I see, in
init
phase,slardar
has been declarded as a global variable,But global variable has side effect in ngx_lua, so why doing this ,any sepecial consideratin for this?
slardar
could be declarded as a module level variable that could achieve the same goal .--init.lua
local slardar = require "config"
slarder.kk= "any operation you want"
--foo.lua local slarder = require "config" --has been cached by package.loader --you can use slader.kk here
thanks .