diff options
Diffstat (limited to 'web/api/queries/rrdr.c')
-rw-r--r-- | web/api/queries/rrdr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web/api/queries/rrdr.c b/web/api/queries/rrdr.c index ef237fa02..b64868222 100644 --- a/web/api/queries/rrdr.c +++ b/web/api/queries/rrdr.c @@ -100,7 +100,7 @@ inline void rrdr_free(RRDR *r) RRDR *rrdr_create(struct rrdset *st, long n, struct context_param *context_param_list) { - if(unlikely(!st)) { + if (unlikely(!st)) { error("NULL value given!"); return NULL; } @@ -108,7 +108,10 @@ RRDR *rrdr_create(struct rrdset *st, long n, struct context_param *context_param RRDR *r = callocz(1, sizeof(RRDR)); r->st = st; - rrdr_lock_rrdset(r); + if (!context_param_list || !(context_param_list->flags & CONTEXT_FLAGS_ARCHIVE)) { + rrdr_lock_rrdset(r); + r->st_needs_lock = 1; + } RRDDIM *temp_rd = context_param_list ? context_param_list->rd : NULL; RRDDIM *rd; |