From 6cf6c36937ab276dba3f8a23fc16b2f10c0bc072 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 25 Oct 2021 12:00:43 +0300 Subject: [PATCH] Replace deprecated REDISMODULE_POSTPONED_ARRAY_LEN in module tests and examples (#9677) REDISMODULE_POSTPONED_ARRAY_LEN is deprecated, use REDISMODULE_POSTPONED_LEN instead --- src/modules/helloblock.c | 2 +- src/modules/hellodict.c | 2 +- src/modules/hellotype.c | 2 +- src/modules/helloworld.c | 2 +- tests/modules/getkeys.c | 2 +- tests/modules/scan.c | 2 +- tests/modules/stream.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/helloblock.c b/src/modules/helloblock.c index b90ccaa50..afdfeece4 100644 --- a/src/modules/helloblock.c +++ b/src/modules/helloblock.c @@ -142,7 +142,7 @@ void *HelloKeys_ThreadMain(void *arg) { long long cursor = 0; size_t replylen = 0; - RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN); do { RedisModule_ThreadSafeContextLock(ctx); RedisModuleCallReply *reply = RedisModule_Call(ctx, diff --git a/src/modules/hellodict.c b/src/modules/hellodict.c index 3725e432a..2a836c491 100644 --- a/src/modules/hellodict.c +++ b/src/modules/hellodict.c @@ -89,7 +89,7 @@ int cmd_KEYRANGE(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { char *key; size_t keylen; long long replylen = 0; /* Keep track of the emitted array len. */ - RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN); while((key = RedisModule_DictNextC(iter,&keylen,NULL)) != NULL) { if (replylen >= count) break; if (RedisModule_DictCompare(iter,"<=",argv[2]) == REDISMODULE_ERR) diff --git a/src/modules/hellotype.c b/src/modules/hellotype.c index 4a251f888..1dc53d24c 100644 --- a/src/modules/hellotype.c +++ b/src/modules/hellotype.c @@ -161,7 +161,7 @@ int HelloTypeRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, i struct HelloTypeObject *hto = RedisModule_ModuleTypeGetValue(key); struct HelloTypeNode *node = hto ? hto->head : NULL; - RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN); long long arraylen = 0; while(node && count--) { RedisModule_ReplyWithLongLong(ctx,node->value); diff --git a/src/modules/helloworld.c b/src/modules/helloworld.c index 043f5be32..e51796310 100644 --- a/src/modules/helloworld.c +++ b/src/modules/helloworld.c @@ -443,7 +443,7 @@ int HelloLexRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, in } int arraylen = 0; - RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN); while(!RedisModule_ZsetRangeEndReached(key)) { double score; RedisModuleString *ele = RedisModule_ZsetRangeCurrentElement(key,&score); diff --git a/tests/modules/getkeys.c b/tests/modules/getkeys.c index 706054174..3f7cc56f0 100644 --- a/tests/modules/getkeys.c +++ b/tests/modules/getkeys.c @@ -30,7 +30,7 @@ int getkeys_command(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) } /* Handle real command invocation */ - RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN); for (i = 0; i < argc; i++) { size_t len; const char *str = RedisModule_StringPtrLen(argv[i], &len); diff --git a/tests/modules/scan.c b/tests/modules/scan.c index 1576bae9e..1723d3097 100644 --- a/tests/modules/scan.c +++ b/tests/modules/scan.c @@ -36,7 +36,7 @@ int scan_strings(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) .nkeys = 0, }; - RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN); RedisModuleScanCursor* cursor = RedisModule_ScanCursorCreate(); while(RedisModule_Scan(ctx, cursor, scan_strings_callback, &pd)); diff --git a/tests/modules/stream.c b/tests/modules/stream.c index abfbb1faf..b82568b94 100644 --- a/tests/modules/stream.c +++ b/tests/modules/stream.c @@ -132,7 +132,7 @@ int stream_range(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { assert(errno == ENOENT); /* Return array. */ - RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); + RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN); RedisModule_AutoMemory(ctx); RedisModuleStreamID id; long numfields;