forked from platypush/platypush
Assigning plugins[plugin_name] inside of the synchronized block
This commit is contained in:
parent
4c6b38a6e2
commit
a6339de159
1 changed files with 2 additions and 3 deletions
|
@ -97,13 +97,12 @@ def get_plugin(plugin_name, reload=False):
|
||||||
plugin_class = getattr(plugin, cls_name)
|
plugin_class = getattr(plugin, cls_name)
|
||||||
|
|
||||||
with plugins_init_locks[plugin_name]:
|
with plugins_init_locks[plugin_name]:
|
||||||
plugin = plugin_class(**plugin_conf)
|
plugins[plugin_name] = plugin_class(**plugin_conf)
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
logger.warning('No such class in {}: {}'.format(plugin_name, cls_name))
|
logger.warning('No such class in {}: {}'.format(plugin_name, cls_name))
|
||||||
raise RuntimeError(e)
|
raise RuntimeError(e)
|
||||||
|
|
||||||
plugins[plugin_name] = plugin
|
return plugins[plugin_name]
|
||||||
return plugin
|
|
||||||
|
|
||||||
def get_bus():
|
def get_bus():
|
||||||
global main_bus
|
global main_bus
|
||||||
|
|
Loading…
Reference in a new issue