TT#14008 fix Redis restore logic re legacy format

closes #1486

Change-Id: Id479816d916bec11dae700fd24a86348f75c42c5
pull/1498/head
Richard Fuchs 4 years ago
parent e0e9bdc9dc
commit 0da7a068b0

@ -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) {

Loading…
Cancel
Save