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

Function RM_StopTimer

app/redis-6.2.6/src/module.c:6382–6390  ·  view source on GitHub ↗

Stop a timer, returns REDISMODULE_OK if the timer was found, belonged to the * calling module, and was stopped, otherwise REDISMODULE_ERR is returned. * If not NULL, the data pointer is set to the value of the data argument when * the timer was created. */

Source from the content-addressed store, hash-verified

6380 * If not NULL, the data pointer is set to the value of the data argument when
6381 * the timer was created. */
6382int RM_StopTimer(RedisModuleCtx *ctx, RedisModuleTimerID id, void **data) {
6383 RedisModuleTimer *timer = raxFind(Timers,(unsigned char*)&id,sizeof(id));
6384 if (timer == raxNotFound || timer->module != ctx->module)
6385 return REDISMODULE_ERR;
6386 if (data) *data = timer->data;
6387 raxRemove(Timers,(unsigned char*)&id,sizeof(id),NULL);
6388 zfree(timer);
6389 return REDISMODULE_OK;
6390}
6391
6392/* Obtain information about a timer: its remaining time before firing
6393 * (in milliseconds), and the private data pointer associated with the timer.

Callers

nothing calls this directly

Calls 3

raxFindFunction · 0.85
raxRemoveFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected