Move the metric put outside the transaction

This commit is contained in:
Matt Jibson 2015-09-21 13:37:49 -04:00
parent 2ff77df946
commit 4da66c1219

View file

@ -128,9 +128,9 @@ class WorkQueue(object):
with self._transaction_factory(db):
r = str(QueueItem.create(**params).id)
if self._metric_queue:
self._metric_queue.put('Added', 1, dimensions={'queue': self._queue_name})
return r
if self._metric_queue:
self._metric_queue.put('Added', 1, dimensions={'queue': self._queue_name})
return r
def get(self, processing_time=300):
"""