Implement keepalive plugin (#2456)

This commit is contained in:
Hzj_jie
2016-12-27 02:03:11 -08:00
committed by Qingping Hou
parent 9e9f4be5be
commit ce6bc3df8d
3 changed files with 54 additions and 3 deletions

View File

@@ -20,10 +20,10 @@ function PluginLoader:loadPlugins()
package.path = path.."/?.lua;"..package.path
package.cpath = path.."/lib/?.so;"..package.cpath
local ok, plugin_module = pcall(dofile, mainfile)
if not ok then
if not ok or not plugin_module then
DEBUG("Error when loading", mainfile, plugin_module)
end
if not plugin_module.disabled and ok then
if ok and plugin_module and not plugin_module.disabled then
package.path = package_path
package.cpath = package_cpath
plugin_module.path = path