diff --git a/src/module.c b/src/module.c index 3e5cdf4a3d..af0e31d336 100644 --- a/src/module.c +++ b/src/module.c @@ -2258,7 +2258,6 @@ int moduleIsModuleCommand(void *module_handle, struct serverCommand *cmd) { * The function parameter 'argc' indicates the number of updated arguments, and 'argv' * represents the values of the updated arguments. * Once 'CONFIG REWRITE' command is called, the updated argument values can be saved into conf file. - * One example can be found in file tests/modules/moduleparameter.c. * * Returns: * - VALKEYMODULE_OK on successfully updating. diff --git a/src/redismodule.h b/src/redismodule.h index 1992ecab1c..d692104d52 100644 --- a/src/redismodule.h +++ b/src/redismodule.h @@ -357,7 +357,6 @@ #define RedisModule_SetModuleAttribs ValkeyModule_SetModuleAttribs #define RedisModule_IsModuleNameBusy ValkeyModule_IsModuleNameBusy #define RedisModule_WrongArity ValkeyModule_WrongArity -#define RedisModule_UpdateRuntimeArgs ValkeyModule_UpdateRuntimeArgs #define RedisModule_ReplyWithLongLong ValkeyModule_ReplyWithLongLong #define RedisModule_GetSelectedDb ValkeyModule_GetSelectedDb #define RedisModule_SelectDb ValkeyModule_SelectDb diff --git a/tests/modules/moduleparameter.c b/tests/modules/moduleparameter.c index 171c5e157e..1f681f93a6 100644 --- a/tests/modules/moduleparameter.c +++ b/tests/modules/moduleparameter.c @@ -4,7 +4,8 @@ #include #include -int GET_HELLO(ValkeyModuleCtx *ctx, ValkeyModuleString **argv, int argc) { +int test_module_update_parameter(ValkeyModuleCtx *ctx, + ValkeyModuleString **argv, int argc) { ValkeyModule_UpdateRuntimeArgs(ctx, argv, argc); return ValkeyModule_ReplyWithSimpleString(ctx, "Module runtime args test"); } @@ -13,13 +14,14 @@ int ValkeyModule_OnLoad(ValkeyModuleCtx *ctx, ValkeyModuleString **argv, int arg VALKEYMODULE_NOT_USED(argv); VALKEYMODULE_NOT_USED(argc); - if (ValkeyModule_Init(ctx,"myhello",1,VALKEYMODULE_APIVER_1) - == VALKEYMODULE_ERR) return VALKEYMODULE_ERR; + if (ValkeyModule_Init(ctx, "moduleparameter", 1, VALKEYMODULE_APIVER_1) == + VALKEYMODULE_ERR) + return VALKEYMODULE_ERR; - - if (ValkeyModule_CreateCommand(ctx,"hello.hi", - GET_HELLO,"fast",0,0,0) == VALKEYMODULE_ERR) - return VALKEYMODULE_ERR; + if (ValkeyModule_CreateCommand(ctx, "testmoduleparameter.update.parameter", + test_module_update_parameter, "fast", 0, 0, + 0) == VALKEYMODULE_ERR) + return VALKEYMODULE_ERR; return VALKEYMODULE_OK; } diff --git a/tests/unit/moduleapi/moduleconfigs.tcl b/tests/unit/moduleapi/moduleconfigs.tcl index 2c03e6e8dd..fbc2dc78ca 100644 --- a/tests/unit/moduleapi/moduleconfigs.tcl +++ b/tests/unit/moduleapi/moduleconfigs.tcl @@ -250,9 +250,9 @@ start_server {tags {"modules"}} { set t [r module list] set modulename [lmap x [r module list] {dict get $x name}] - assert_not_equal [lsearch $modulename myhello] -1 + assert_not_equal [lsearch $modulename moduleparameter] -1 string match "10 20 30" [lmap x [r module list] {dict get $x args}] - r hello.hi 40 50 60 70 + r testmoduleparameter.update.parameter 40 50 60 70 string match "40 50 60 70" [lmap x [r module list] {dict get $x args}] } }