From 1bd634213ef0fc1291d6ef7769321bbc60bf6bea Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 4 Nov 2015 16:34:29 +0100 Subject: [PATCH] Don't append duplicate nodes returned by the finder --- graphite_api/render/datalib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graphite_api/render/datalib.py b/graphite_api/render/datalib.py index fe07605..9301abd 100644 --- a/graphite_api/render/datalib.py +++ b/graphite_api/render/datalib.py @@ -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) @@ -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: