mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
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:
parent
00362f2a94
commit
6cf6c36937
@ -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,
|
||||||
|
@ -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)
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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));
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user