Skip to content

Commit

Permalink
improve dehydrator print to spot issues
Browse files Browse the repository at this point in the history
  • Loading branch information
daTokenizer committed Nov 21, 2016
1 parent d47007d commit 4dfee11
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions module.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,26 @@ void printDehydrator(Dehydrator* dehydrator)
}
}

printf("\n======== element_nodes =========\n");
printf("\n======== element_nodes issues=========\n");
int found_problems = 0;
for (k = kh_begin(dehydrator->element_nodes); k != kh_end(dehydrator->element_nodes); ++k)
{
if (kh_exist(dehydrator->element_nodes, k))
{
ElementListNode* node = kh_value(dehydrator->element_nodes, k);
printRedisStr(node->element_id,kh_key(dehydrator->element_nodes, k));
if (!RMUtil_StringEqualsC(node->element_id, kh_key(dehydrator->element_nodes, k)))
{
printf("node with id: %s is stored under id: %s\n",
RedisModule_StringPtrLen(node->element_id, NULL),
kh_key(dehydrator->element_nodes, k));
found_problems = 1;
}
}
}
if (!found_problems)
{
printf("no issues were found.\n");
}
printf("\n================================\n");
}

Expand Down

0 comments on commit 4dfee11

Please sign in to comment.