Skip to content

Commit

Permalink
Avoid a memory leak when appending tags
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbranagan committed Jan 14, 2014
1 parent 24f556a commit 43071c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions checks.d/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def check(self, instance):
server = instance['server']
tags = instance.get('tags', [])
tags.append('server:%s' % server)
# de-dupe tags to avoid a memory leak
tags = list(set(tags))

try:
from pymongo import Connection
Expand Down

0 comments on commit 43071c7

Please sign in to comment.