Replace deprecated REDISMODULE_POSTPONED_ARRAY_LEN in module tests and examples (#9677)

REDISMODULE_POSTPONED_ARRAY_LEN is deprecated, use REDISMODULE_POSTPONED_LEN instead
This commit is contained in:
Guy Korland 2021-10-25 12:00:43 +03:00 committed by GitHub
parent 00362f2a94
commit 6cf6c36937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

View File

@ -142,7 +142,7 @@ void *HelloKeys_ThreadMain(void *arg) {
long long cursor = 0; long long cursor = 0;
size_t replylen = 0; size_t replylen = 0;
RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN);
do { do {
RedisModule_ThreadSafeContextLock(ctx); RedisModule_ThreadSafeContextLock(ctx);
RedisModuleCallReply *reply = RedisModule_Call(ctx, RedisModuleCallReply *reply = RedisModule_Call(ctx,

View File

@ -89,7 +89,7 @@ int cmd_KEYRANGE(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
char *key; char *key;
size_t keylen; size_t keylen;
long long replylen = 0; /* Keep track of the emitted array len. */ 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) { while((key = RedisModule_DictNextC(iter,&keylen,NULL)) != NULL) {
if (replylen >= count) break; if (replylen >= count) break;
if (RedisModule_DictCompare(iter,"<=",argv[2]) == REDISMODULE_ERR) if (RedisModule_DictCompare(iter,"<=",argv[2]) == REDISMODULE_ERR)

View File

@ -161,7 +161,7 @@ int HelloTypeRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, i
struct HelloTypeObject *hto = RedisModule_ModuleTypeGetValue(key); struct HelloTypeObject *hto = RedisModule_ModuleTypeGetValue(key);
struct HelloTypeNode *node = hto ? hto->head : NULL; struct HelloTypeNode *node = hto ? hto->head : NULL;
RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN);
long long arraylen = 0; long long arraylen = 0;
while(node && count--) { while(node && count--) {
RedisModule_ReplyWithLongLong(ctx,node->value); RedisModule_ReplyWithLongLong(ctx,node->value);

View File

@ -443,7 +443,7 @@ int HelloLexRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, in
} }
int arraylen = 0; int arraylen = 0;
RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_LEN);
while(!RedisModule_ZsetRangeEndReached(key)) { while(!RedisModule_ZsetRangeEndReached(key)) {
double score; double score;
RedisModuleString *ele = RedisModule_ZsetRangeCurrentElement(key,&score); RedisModuleString *ele = RedisModule_ZsetRangeCurrentElement(key,&score);

View File

@ -30,7 +30,7 @@ int getkeys_command(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
} }
/* Handle real command invocation */ /* Handle real command invocation */
RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN);
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
size_t len; size_t len;
const char *str = RedisModule_StringPtrLen(argv[i], &len); const char *str = RedisModule_StringPtrLen(argv[i], &len);

View File

@ -36,7 +36,7 @@ int scan_strings(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
.nkeys = 0, .nkeys = 0,
}; };
RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN);
RedisModuleScanCursor* cursor = RedisModule_ScanCursorCreate(); RedisModuleScanCursor* cursor = RedisModule_ScanCursorCreate();
while(RedisModule_Scan(ctx, cursor, scan_strings_callback, &pd)); while(RedisModule_Scan(ctx, cursor, scan_strings_callback, &pd));

View File

@ -132,7 +132,7 @@ int stream_range(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
assert(errno == ENOENT); assert(errno == ENOENT);
/* Return array. */ /* Return array. */
RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN); RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_LEN);
RedisModule_AutoMemory(ctx); RedisModule_AutoMemory(ctx);
RedisModuleStreamID id; RedisModuleStreamID id;
long numfields; long numfields;