From fe9e19704bec0a02fadb8419d3c8b2e39ad82d84 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 16 Jan 2015 15:31:40 -0500 Subject: [PATCH] Try/Catch creating connection to CloudWatch --- util/queuemetrics.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/queuemetrics.py b/util/queuemetrics.py index ce19b9e28..25db79b3c 100644 --- a/util/queuemetrics.py +++ b/util/queuemetrics.py @@ -49,8 +49,12 @@ class SendToCloudWatch(Thread): self._put_metrics_queue = request_queue def run(self): - logger.debug('Starting CloudWatch sender process.') - connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key) + try: + logger.debug('Starting CloudWatch sender process.') + connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key) + except: + logger.exception('Failed to connect to CloudWatch.') + while True: put_metric_args, kwargs = self._put_metrics_queue.get() logger.debug('Got queued put metrics request.')