Modules: use RedisModule_AbortBlock() in the example.

This commit is contained in:
antirez 2016-10-13 17:00:29 +02:00
parent 95c17c0cb2
commit a3b3ca7c21

View File

@ -99,7 +99,7 @@ int HelloBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int a
targ[1] = (void*)(unsigned long) delay; targ[1] = (void*)(unsigned long) delay;
if (pthread_create(&tid,NULL,HelloBlock_ThreadMain,targ) != 0) { if (pthread_create(&tid,NULL,HelloBlock_ThreadMain,targ) != 0) {
/* RedisModule_BlockedClientAbort(bc); */ RedisModule_AbortBlock(bc);
return RedisModule_ReplyWithError(ctx,"-ERR Can't start thread"); return RedisModule_ReplyWithError(ctx,"-ERR Can't start thread");
} }
return REDISMODULE_OK; return REDISMODULE_OK;