summaryrefslogtreecommitdiffstats
path: root/web/api/web_api_v1.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/api/web_api_v1.c')
-rw-r--r--web/api/web_api_v1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index 7c5f9fb9e8..72962f9b10 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -511,6 +511,8 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
rrdhost_unlock(host);
if (likely(context_param_list && context_param_list->rd)) // Just set the first one
st = context_param_list->rd->rrdset;
+ else
+ sql_build_context_param_list(&context_param_list, host, context, NULL);
}
else {
st = rrdset_find(host, chart);
@@ -518,6 +520,17 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
st = rrdset_find_byname(host, chart);
if (likely(st))
st->last_accessed_time = now_realtime_sec();
+ else
+ sql_build_context_param_list(&context_param_list, host, NULL, chart);
+ }
+
+ if (!st) {
+ if (likely(context_param_list && context_param_list->rd && context_param_list->rd->rrdset))
+ st = context_param_list->rd->rrdset;
+ else {
+ free_context_param_list(&context_param_list);
+ context_param_list = NULL;
+ }
}
if (!st && !context_param_list) {