I'm trying to hot reload a Lua module but the standard way to do it doesn't seem to be working in my case.
I have created 2 simple example modules, 'app.lua' and 'test.lua', where the former one serves as an entry point to the application:
# app.lua
test2 = require("test")
while 1 > 0 do
test2.p()
end
and loads a function from the latter one:
# test.lua
local test = {}
function test.p()
print("!!!")
end
return test
This application is running in a docker container build from an official Tarantool image. Let's suppose I have made changes in the code of the 'test' module, say, changed the line with print to 'print("???")'. The standard way to reload a module is to enter the tarantool console on a container and assign nil
to the package.loaded['<name_module>']
. However, when I type it in, the console says it's already null:
tarantool> package.loaded['test']
---
- null
...
What am I doing wrong here?