Last active
July 1, 2018 18:23
-
-
Save aensidhe/e07b0b50dfe613fdceb7d91d52977302 to your computer and use it in GitHub Desktop.
reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reload () | |
log.info(' module reloading started ...') | |
if my_module ~= nil then | |
-- hot code reload using tarantoolctl or dofile() | |
-- unload old application | |
my_module.stop() | |
-- clear cache for loaded modules and dependencies | |
package.loaded['my_module'] = nil | |
end | |
-- load a new version of app and all dependencies | |
evote = require('my_module') | |
my_module.start() | |
log.info('Evote module reloading finished.') | |
end | |
reload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment