added support for domains

This commit is contained in:
dcore94 2020-10-08 14:43:35 +02:00
parent e8ade4014f
commit 984ecbab7b
3 changed files with 20 additions and 6 deletions

View File

@ -1,11 +1,13 @@
[common]
server = http://conductorserver:8080/api
server = http://nubis2.int.d4science.net:8080/api
#domain = comma separated list of task domains to be applied to all task types as fallback
[pyrest]
threads = 3
pollrate = .1
#domain = comma separated list of task domains to be applied to pyrest task type
[pyexec]
threads = 3
pollrate = .1
#domain = comma separated list of task domains to be applied to pyexec task type

View File

@ -33,9 +33,15 @@ def main():
threads = cfg["pyexec"].getint("threads")
pollrate = cfg["pyexec"].getfloat("pollrate")
server = os.environ.get('CONDUCTOR_SERVER', cfg["common"]["server"])
domain = cfg["pyexec"].get("domain")
if domain is None:
domain = cfg["common"].get("domain")
elif cfg["common"].get("domain") is not None:
domain = domain + "," + cfg["common"].get("domain")
cc = ConductorWorker(server, threads, pollrate, "pyexec")
cc.start('pyexec', pyexec, True)
cc.start('pyexec', pyexec, True, domain)
if __name__ == '__main__':
main()

View File

@ -29,9 +29,15 @@ def main():
threads = cfg["pyrest"].getint("threads")
pollrate = cfg["pyrest"].getfloat("pollrate")
server = os.environ.get('CONDUCTOR_SERVER', cfg["common"]["server"])
domain = cfg["pyrest"].get("domain")
if domain is None:
domain = cfg["common"].get("domain")
elif cfg["common"].get("domain") is not None:
domain = domain + "," + cfg["common"].get("domain")
cc = ConductorWorker(server, threads, pollrate, "pyrest")
cc.start('pyrest', pyrest, True)
cc.start('pyrest', pyrest, True, domain)
if __name__ == '__main__':
main()