createULongConfig("active-defrag-max-scan-fields",NULL,MODIFIABLE_CONFIG,1,LONG_MAX,server.active_defrag_max_scan_fields,1000,INTEGER_CONFIG,NULL,NULL),/* Default: keys with more than 1000 fields will be processed separately */
* 2. If we are running in a thread (execution_nesting will be dealt with
* when locking/unlocking the GIL) */
if (!(ctx_flags & (REDISMODULE_CTX_THREAD_SAFE|REDISMODULE_CTX_COMMAND))) {
server.execution_nesting++;
enterExecutionUnit(1, 0);
}
}
...
...
@@ -1076,6 +1152,7 @@ RedisModuleCommand *moduleCreateCommandProxy(struct RedisModule *module, sds dec
* convention.
*
* The function returns REDISMODULE_ERR in these cases:
* - If creation of module command is called outside the RedisModule_OnLoad.
* - The specified command is already busy.
* - The command name contains some chars that are not allowed.
* - A set of invalid flags were passed.
...
...
@@ -1164,8 +1241,11 @@ RedisModuleCommand *moduleCreateCommandProxy(struct RedisModule *module, sds dec
* NOTE: The scheme described above serves a limited purpose and can
* only be used to find keys that exist at constant indices.
* For non-trivial key arguments, you may pass 0,0,0 and use
* RedisModule_SetCommandInfo to set key specs using a more advanced scheme. */
* RedisModule_SetCommandInfo to set key specs using a more advanced scheme and use
* RedisModule_SetCommandACLCategories to set Redis ACL categories of the commands. */
int RM_CreateCommand(RedisModuleCtx *ctx, const char *name, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep) {
* * `parent` is already a subcommand (we do not allow more than one level of command nesting)
* * `parent` is a command with an implementation (RedisModuleCmdFunc) (A parent command should be a pure container of subcommands)
* * `parent` already has a subcommand called `name`
* * Creating a subcommand is called outside of RedisModule_OnLoad.
*/
int RM_CreateSubcommand(RedisModuleCommand *parent, const char *name, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep) {