| 2651 | } |
| 2652 | |
| 2653 | static PyObject* DAGRun(PyObject *self){ |
| 2654 | verifyRedisAILoaded(); |
| 2655 | PyDAGRunner *pyDag = (PyDAGRunner *)self; |
| 2656 | if(!_IsDagAPISupported(RedisAI_DAGRun) || !_IsValidDag(pyDag)) { |
| 2657 | return NULL; |
| 2658 | } |
| 2659 | PyObject* pArgs = PyTuple_New(0); |
| 2660 | PyObject* future = PyObject_CallObject(createFutureFunction, pArgs); |
| 2661 | GearsPyDecRef(pArgs); |
| 2662 | |
| 2663 | RAI_Error *err; |
| 2664 | RedisAI_InitError(&err); |
| 2665 | int status = RedisAI_DAGRun(pyDag->dag, FinishAsyncDAGRun, future, err); |
| 2666 | if (status == REDISMODULE_ERR) { |
| 2667 | PyErr_SetString(GearsError, RedisAI_GetError(err)); |
| 2668 | pyDag->dag = NULL; |
| 2669 | RedisAI_FreeError(err); |
| 2670 | return NULL; |
| 2671 | } |
| 2672 | pyDag->dag = NULL; |
| 2673 | RedisAI_FreeError(err); |
| 2674 | Py_INCREF(future); |
| 2675 | return future; |
| 2676 | } |
| 2677 | |
| 2678 | // LCOV_EXCL_STOP |
| 2679 |
nothing calls this directly
no test coverage detected