MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / createReply

Function createReply

plugins/python/redisgears_python.c:3211–3234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3209}
3210
3211static PyObject* createReply(RedisModuleCallReply *reply){
3212 PyObject* res = NULL;
3213 if(!reply || RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_UNKNOWN){
3214 if(errno){
3215 PyErr_SetString(GearsError, strerror(errno));
3216 }else{
3217 PyErr_SetString(GearsError, "Failed executing command");
3218 }
3219 res = NULL;
3220 }
3221 else if(RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_ERROR){
3222 size_t len;
3223 const char* replyStr = RedisModule_CallReplyStringPtr(reply, &len);
3224 PyErr_SetString(GearsError, replyStr);
3225 }else{
3226 res = replyToPyList(reply);
3227 }
3228
3229 if(reply){
3230 RedisModule_FreeCallReply(reply);
3231 }
3232
3233 return res;
3234}
3235
3236static PyObject* executeCommand(PyObject *cls, PyObject *args){
3237 if(PyTuple_Size(args) < 1){

Callers 2

executeCommandFunction · 0.85
callNextFunction · 0.85

Calls 1

replyToPyListFunction · 0.85

Tested by

no test coverage detected