diff --git a/lib/galaxy/queue_worker.py b/lib/galaxy/queue_worker.py index 43eef881de1..cd01231e5a7 100644 --- a/lib/galaxy/queue_worker.py +++ b/lib/galaxy/queue_worker.py @@ -30,10 +30,13 @@ class GalaxyQueueWorker(ConsumerMixin, threading.Thread): handler, will have one of these used for dispatching so called 'control' tasks. """ - def __init__(self, app, queue, task_mapping): + def __init__(self, app, queue, task_mapping, connection=None): super(GalaxyQueueWorker, self).__init__() log.info("Initalizing Galaxy Queue Worker on %s" % app.config.amqp_internal_connection) - self.connection = Connection(app.config.amqp_internal_connection) + if connection: + self.connection = connection + else: + self.connection = Connection(app.config.amqp_internal_connection) self.app = app # Eventually we may want different workers w/ their own queues and task # mappings. Right now, there's only the one.