From 005c932f22a5e3027db2c31865e394d388fcf0a0 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 12 Apr 2018 13:00:18 +0200 Subject: [PATCH] Modules API: fix timer example. --- src/modules/hellotimer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/hellotimer.c b/src/modules/hellotimer.c index 9be4e1e4..6c3e1d7f 100644 --- a/src/modules/hellotimer.c +++ b/src/modules/hellotimer.c @@ -30,6 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#define REDISMODULE_EXPERIMENTAL_API #include "../redismodule.h" #include #include @@ -41,6 +42,7 @@ /* Timer callback. */ void timerHandler(RedisModuleCtx *ctx, void *data) { + REDISMODULE_NOT_USED(ctx); printf("Fired %s!\n", data); RedisModule_Free(data); } @@ -55,6 +57,7 @@ int TimerCommand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int char *buf = RedisModule_Alloc(256); snprintf(buf,256,"After %d", delay); RedisModuleTimerID tid = RedisModule_CreateTimer(ctx,delay,timerHandler,buf); + REDISMODULE_NOT_USED(tid); } return RedisModule_ReplyWithSimpleString(ctx, "OK"); }