Unverified Commit 7980d87c authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4842 from soloestoy/fix-timer-api-wrong-insert

Modules Timer API: fix wrong raxInsert() usage
parents e07af6a2 775adf54
......@@ -4206,9 +4206,8 @@ RedisModuleTimerID RM_CreateTimer(RedisModuleCtx *ctx, mstime_t period, RedisMod
while(1) {
key = htonu64(expiretime);
int retval = raxInsert(Timers,(unsigned char*)&key,sizeof(key),timer,NULL);
if (retval) {
expiretime = key;
if (raxFind(Timers, (unsigned char*)&key,sizeof(key)) == raxNotFound) {
raxInsert(Timers,(unsigned char*)&key,sizeof(key),timer,NULL);
break;
} else {
expiretime++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment