diff --git a/scripts/qiita b/scripts/qiita index 65153b0ba..e43954ecf 100755 --- a/scripts/qiita +++ b/scripts/qiita @@ -452,16 +452,24 @@ def start(port, master): if master: def callback_function(): - for s in qdb.software.Software.iter_active(): + active_software = list(qdb.software.Software.iter_active()) + sdefinition = [s for s in active_software + if s.type == 'artifact definition'] + stransformation = [s for s in active_software + if s.type == 'artifact transformation'] + # registering definition artifacts + for s in sdefinition: + s.register_commands() + sleep(0.5) + # sleep to make sure that all definitions are done + sleep(3) + for s in stransformation: s.register_commands() - # Not sure why this sleep is needed, but when testing in the - # test environment, some of the plugins were not registered - # unless this sleep was added here sleep(0.5) ioloop.add_timeout(ioloop.time() + 0.5, callback_function) - # Set a PeriodicCallback for cleaning up the threads every 10 seconds + # Set a PeriodicCallback for cleaning up the threads # To understand why this is working as expected, check the multiprocessing # documentation https://docs.python.org/2/library/multiprocessing.html # 600000 == 10 min