Skip to content

Commit 4c2c12f

Browse files
committed
Merge branch 'master' of github.com:brutasse/graphite-api
2 parents 09a41f2 + e770185 commit 4c2c12f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

graphite_api/render/datalib.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def fetchData(requestContext, pathExprs):
130130
# Convert to list if given single path
131131
if not isinstance(pathExprs, list):
132132
pathExprs = [pathExprs]
133-
pathExprs = set(pathExprs)
134133

135134
data_store = DataStore()
136135
multi_nodes = defaultdict(list)
@@ -140,14 +139,15 @@ def fetchData(requestContext, pathExprs):
140139

141140
# Group nodes that support multiple fetches
142141
for pathExpr in pathExprs:
143-
for node in app.store.find(pathExpr):
142+
for node in app.store.find(pathExpr, startTime, endTime):
144143
if not node.is_leaf:
145144
continue
145+
if node.path not in path_to_exprs:
146+
if hasattr(node, '__fetch_multi__'):
147+
multi_nodes[node.__fetch_multi__].append(node)
148+
else:
149+
single_nodes.append(node)
146150
path_to_exprs[node.path].append(pathExpr)
147-
if hasattr(node, '__fetch_multi__'):
148-
multi_nodes[node.__fetch_multi__].append(node)
149-
else:
150-
single_nodes.append(node)
151151

152152
# Multi fetches
153153
for finder in app.store.finders:
@@ -159,7 +159,7 @@ def fetchData(requestContext, pathExprs):
159159
time_info, series = finder.fetch_multi(nodes, startTime, endTime)
160160
for path, values in series.items():
161161
data_store.add_data(path, time_info, values,
162-
path_to_exprs[node.path])
162+
path_to_exprs[path])
163163

164164
# Single fetches
165165
fetches = [

0 commit comments

Comments
 (0)