Fix installing requirements

This commit is contained in:
zewelor
2017-11-29 09:29:06 +01:00
parent a1676b3e10
commit ddc224f389
2 changed files with 21 additions and 19 deletions
+2 -1
View File
@@ -28,11 +28,12 @@ class WorkersManager:
for (worker_name, worker_config) in config.items():
module_obj = importlib.import_module("workers.%s" % worker_name)
klass = getattr(module_obj, "%sWorker" % worker_name.title())
worker_obj = klass(**worker_config['args'])
if module_obj.REQUIREMENTS is not None:
cls._pip_install_helper(module_obj.REQUIREMENTS)
worker_obj = klass(**worker_config['args'])
if 'update_interval' in worker_config:
_LOGGER.debug("Added: %s with %d seconds interval" % (worker_name, worker_config['update_interval']))
_WORKERS_QUEUE.put(cls.Command(worker_obj.status_update, []))