Reload plugins if already loaded
This commit is contained in:
parent
8e8605615f
commit
5c11e240b1
1 changed files with 7 additions and 4 deletions
|
@ -493,10 +493,13 @@ class PluginManager(metaclass=Singleton):
|
||||||
|
|
||||||
module = None
|
module = None
|
||||||
|
|
||||||
if module_name in sys.modules:
|
|
||||||
# do not load the module twice
|
|
||||||
continue
|
|
||||||
try:
|
try:
|
||||||
|
if module_name in sys.modules:
|
||||||
|
from imp import reload
|
||||||
|
log.info('Reloading %s', module_name)
|
||||||
|
module = reload(sys.modules[module_name])
|
||||||
|
else:
|
||||||
|
log.info('Loading %s', module_name)
|
||||||
module = __import__(module_name)
|
module = __import__(module_name)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
log.warning(
|
log.warning(
|
||||||
|
|
Loading…
Add table
Reference in a new issue