Skip to content

Instantly share code, notes, and snippets.

@aensidhe
Last active July 1, 2018 18:23
Show Gist options
  • Save aensidhe/e07b0b50dfe613fdceb7d91d52977302 to your computer and use it in GitHub Desktop.
Save aensidhe/e07b0b50dfe613fdceb7d91d52977302 to your computer and use it in GitHub Desktop.
reload
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