Merge "Increase rabbitmq connections attempt"

This commit is contained in:
Jenkins 2016-12-23 13:12:27 +00:00 committed by Gerrit Code Review
commit 1190973843
3 changed files with 13 additions and 1 deletions

View File

@ -107,6 +107,12 @@ lock_path = $state_path/lock
# The name of the queue that will be created for API events.
# rabbit_event_queue_name=storyboard_events
# The number of connection attempts before giving-up
# rabbit_connection_attempts = 6
# The interval between connection attempts (in seconds)
# rabbit_retry_delay = 10
[database]
# This line MUST be changed to actually run storyboard
# Example:

View File

@ -40,4 +40,8 @@ NOTIFICATION_OPTS = [
cfg.StrOpt("rabbit_virtual_host", default="/",
help="The virtual host within which our queues and exchanges "
"live."),
cfg.IntOpt("rabbit_connection_attempts", default=6,
help="The number of connection attempts before giving-up"),
cfg.IntOpt("rabbit_retry_delay", default=10,
help="The interval between connection attempts (in seconds)")
]

View File

@ -56,7 +56,9 @@ class ConnectionService(object):
conf.rabbit_host,
conf.rabbit_port,
conf.rabbit_virtual_host,
self._connection_credentials)
self._connection_credentials,
connection_attempts=conf.rabbit_connection_attempts,
retry_delay=conf.rabbit_retry_delay)
def _connect(self):
"""This method connects to RabbitMQ, establishes a channel, declares