Modules: create timers in contexts without a client.

This commit is contained in:
antirez 2019-12-03 16:21:23 +01:00
parent 89849c8b01
commit 7b5f4b175b

View File

@ -5150,7 +5150,7 @@ RedisModuleTimerID RM_CreateTimer(RedisModuleCtx *ctx, mstime_t period, RedisMod
timer->module = ctx->module;
timer->callback = callback;
timer->data = data;
timer->dbid = ctx->client->db->id;
timer->dbid = ctx->client ? ctx->client->db->id : 0;
uint64_t expiretime = ustime()+period*1000;
uint64_t key;