| 4380 | RedisModuleType *TimeEventType; |
| 4381 | |
| 4382 | static void TimeEvent_Callback(RedisModuleCtx *ctx, void *data){ |
| 4383 | TimerData* td = data; |
| 4384 | PythonExecutionCtx pectx = PythonExecutionCtx_New(td->session, NULL); |
| 4385 | RedisGearsPy_Lock(&pectx); |
| 4386 | PyObject* pArgs = PyTuple_New(0); |
| 4387 | PyObject_CallObject(td->callback, pArgs); |
| 4388 | if(PyErr_Occurred()){ |
| 4389 | char* error = getPyError(); |
| 4390 | RedisModule_Log(staticCtx, "warning", "Error occured on TimeEvent_Callback, error=%s", error); |
| 4391 | RG_FREE(error); |
| 4392 | td->status =TE_STATUS_ERR; |
| 4393 | }else{ |
| 4394 | td->id = RedisModule_CreateTimer(ctx, td->period * 1000, TimeEvent_Callback, td); |
| 4395 | } |
| 4396 | GearsPyDecRef(pArgs); |
| 4397 | RedisGearsPy_Unlock(&pectx); |
| 4398 | } |
| 4399 | |
| 4400 | static void *TimeEvent_RDBLoad(RedisModuleIO *rdb, int encver){ |
| 4401 | TimerData* td = RG_ALLOC(sizeof(*td)); |
nothing calls this directly
no test coverage detected