mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
Merge af7551e89f into b5a37c0e42
This commit is contained in:
commit
aa2ac1f178
2 changed files with 4 additions and 13 deletions
|
|
@ -143,6 +143,9 @@ int HelloTypeRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, i
|
|||
struct HelloTypeNode *node = hto ? hto->head : NULL;
|
||||
RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN);
|
||||
long long arraylen = 0;
|
||||
while(node && first--) {
|
||||
node = node->next;
|
||||
}
|
||||
while(node && count--) {
|
||||
RedisModule_ReplyWithLongLong(ctx,node->value);
|
||||
arraylen++;
|
||||
|
|
|
|||
|
|
@ -214,25 +214,13 @@ int HelloRandArray_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, i
|
|||
}
|
||||
|
||||
/* This is a simple command to test replication. Because of the "!" modified
|
||||
* in the RedisModule_Call() call, the two INCRs get replicated.
|
||||
* Also note how the ECHO is replicated in an unexpected position (check
|
||||
* comments the function implementation). */
|
||||
* in the RedisModule_Call() call, the two INCRs get replicated.*/
|
||||
int HelloRepl1_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
|
||||
{
|
||||
REDISMODULE_NOT_USED(argv);
|
||||
REDISMODULE_NOT_USED(argc);
|
||||
RedisModule_AutoMemory(ctx);
|
||||
|
||||
/* This will be replicated *after* the two INCR statements, since
|
||||
* the Call() replication has precedence, so the actual replication
|
||||
* stream will be:
|
||||
*
|
||||
* MULTI
|
||||
* INCR foo
|
||||
* INCR bar
|
||||
* ECHO c foo
|
||||
* EXEC
|
||||
*/
|
||||
RedisModule_Replicate(ctx,"ECHO","c","foo");
|
||||
|
||||
/* Using the "!" modifier we replicate the command if it
|
||||
|
|
|
|||
Loading…
Reference in a new issue