mirror of https://github.com/zulip/zulip.git
queue: Refactor Pika credentials code to be a bit cleaner.
This commit is contained in:
parent
6c744564a7
commit
0c42fc2f8f
|
@ -38,9 +38,10 @@ class SimpleQueueClient(object):
|
|||
self._connect()
|
||||
|
||||
def _get_parameters(self):
|
||||
credentials = pika.PlainCredentials(settings.RABBITMQ_USERNAME,
|
||||
settings.RABBITMQ_PASSWORD)
|
||||
return pika.ConnectionParameters(settings.RABBITMQ_HOST,
|
||||
credentials = pika.PlainCredentials(
|
||||
settings.RABBITMQ_USERNAME, settings.RABBITMQ_PASSWORD))
|
||||
credentials=credentials)
|
||||
|
||||
def _generate_ctag(self, queue_name):
|
||||
return "%s_%s" % (queue_name, str(random.getrandbits(16)))
|
||||
|
|
Loading…
Reference in New Issue