From 3bf952cda67b1ff00b95bf2bd7acb12d7db02c5c Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 15 Dec 2016 13:24:29 -0500 Subject: [PATCH] Tell moksha to just listen to /dev/null for local builds. --- module_build_service/scheduler/__init__.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/module_build_service/scheduler/__init__.py b/module_build_service/scheduler/__init__.py index fd1903c7..ccde5b70 100644 --- a/module_build_service/scheduler/__init__.py +++ b/module_build_service/scheduler/__init__.py @@ -21,20 +21,13 @@ def main(initial_messages, stop_condition): config['mbsconsumer.stop_condition'] = stop_condition config['mbsconsumer.initial_messages'] = initial_messages - consumers = [module_build_service.scheduler.consumer.MBSConsumer] + # Moksha requires that we subscribe to *something*, so tell it /dev/null + # since we'll just be doing in-memory queue-based messaging for this single + # build. + config['zmq_enabled'] = True + config['zmq_subscribe_endpoints'] = 'ipc:///dev/null' - # Rephrase the fedmsg-config.py config as moksha *.ini format for - # zeromq. If we're not using zeromq (say, we're using STOMP), then just - # assume that the moksha configuration is specified correctly already - # in /etc/fedmsg.d/ - if config.get('zmq_enabled', True): - moksha_options = dict( - # XXX - replace this with a /dev/null endpoint. - zmq_subscribe_endpoints=','.join( - ','.join(bunch) for bunch in config['endpoints'].values() - ), - ) - config.update(moksha_options) + consumers = [module_build_service.scheduler.consumer.MBSConsumer] # Note that the hub we kick off here cannot send any message. You # should use fedmsg.publish(...) still for that. @@ -47,6 +40,7 @@ def main(initial_messages, stop_condition): framework=False, ) + def make_simple_stop_condition(session): """ Return a simple stop_condition callable.