Skip to content

Commit

Permalink
Don't append duplicate nodes returned by the finder
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Nov 4, 2015
1 parent 1ff1eb5 commit 1bd6342
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions graphite_api/render/datalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def fetchData(requestContext, pathExprs):
# Convert to list if given single path
if not isinstance(pathExprs, list):
pathExprs = [pathExprs]
pathExprs = set(pathExprs)

data_store = DataStore()
multi_nodes = defaultdict(list)
Expand All @@ -143,11 +142,12 @@ def fetchData(requestContext, pathExprs):
for node in app.store.find(pathExpr, startTime, endTime):
if not node.is_leaf:
continue
if node.path not in path_to_exprs:
if hasattr(node, '__fetch_multi__'):
multi_nodes[node.__fetch_multi__].append(node)
else:
single_nodes.append(node)
path_to_exprs[node.path].append(pathExpr)
if hasattr(node, '__fetch_multi__'):
multi_nodes[node.__fetch_multi__].append(node)
else:
single_nodes.append(node)

# Multi fetches
for finder in app.store.finders:
Expand Down

0 comments on commit 1bd6342

Please sign in to comment.