From 0da7a068b02cdee3f80696eea0144157838185ea Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 6 May 2022 09:49:23 -0400 Subject: [PATCH] TT#14008 fix Redis restore logic re legacy format closes #1486 Change-Id: Id479816d916bec11dae700fd24a86348f75c42c5 --- daemon/redis.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/daemon/redis.c b/daemon/redis.c index ab262bd50..d25facbf7 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1623,7 +1623,11 @@ static int json_link_tags(struct call *c, struct redis_list *tags, struct redis_ for (i = 0; i < tags->len; i++) { ml = tags->ptrs[i]; - if (!json_build_list(&q, c, "subscriptions-oa", i, tags, root_reader)) { + if (!json_build_list_cb(NULL, c, "subscriptions", i, tags, rbl_subs_cb, ml, root_reader)) { + // new format, ok + ; + } + else if (!json_build_list(&q, c, "subscriptions-oa", i, tags, root_reader)) { // legacy format for (l = q.head; l; l = l->next) { other_ml = l->data; @@ -1643,11 +1647,6 @@ static int json_link_tags(struct call *c, struct redis_list *tags, struct redis_ } g_queue_clear(&q); } - else { - // new format - if (json_build_list_cb(NULL, c, "subscriptions", i, tags, rbl_subs_cb, ml, root_reader)) - return -1; - } // backwards compatibility if (!ml->subscriptions.length) {