MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clusterManagerExecTransaction

Function clusterManagerExecTransaction

app/redis-6.2.6/src/redis-cli.c:2788–2815  ·  view source on GitHub ↗

Call EXEC command on a cluster node. */

Source from the content-addressed store, hash-verified

2786
2787/* Call EXEC command on a cluster node. */
2788static int clusterManagerExecTransaction(clusterManagerNode *node,
2789 clusterManagerOnReplyError onerror)
2790{
2791 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "EXEC");
2792 int success = clusterManagerCheckRedisReply(node, reply, NULL);
2793 if (success) {
2794 if (reply->type != REDIS_REPLY_ARRAY) {
2795 success = 0;
2796 goto cleanup;
2797 }
2798 size_t i;
2799 for (i = 0; i < reply->elements; i++) {
2800 redisReply *r = reply->element[i];
2801 char *err = NULL;
2802 success = clusterManagerCheckRedisReply(node, r, &err);
2803 if (!success && onerror) success = onerror(r, node, i);
2804 if (err) {
2805 if (!success)
2806 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, err);
2807 zfree(err);
2808 }
2809 if (!success) break;
2810 }
2811 }
2812cleanup:
2813 if (reply) freeReplyObject(reply);
2814 return success;
2815}
2816
2817static int clusterManagerNodeConnect(clusterManagerNode *node) {
2818 if (node->context) redisFree(node->context);

Callers 1

Calls 3

freeReplyObjectFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected