@@ -10,7 +10,7 @@ macro_rules! redis_command {
1010 $mandatory_acl_categories: expr
1111 $( , $optional_acl_categories: expr) ?
1212 ) => { {
13- use redis_module :: AclCategory ;
13+ use $crate :: AclCategory ;
1414
1515 let name = CString :: new( $command_name) . unwrap( ) ;
1616 let flags = CString :: new( $command_flags) . unwrap( ) ;
@@ -48,18 +48,17 @@ macro_rules! redis_command {
4848 return $crate:: raw:: Status :: Err as c_int;
4949 }
5050
51- let command =
52- unsafe { $crate:: raw:: RedisModule_GetCommand . unwrap( ) ( $ctx, name. as_ptr( ) ) } ;
53- if command. is_null( ) {
54- $crate:: raw:: redis_log(
55- $ctx,
56- & format!( "Error: failed to get command {}" , $command_name) ,
57- ) ;
58- return $crate:: raw:: Status :: Err as c_int;
59- }
60-
6151 let mandatory = AclCategory :: from( $mandatory_acl_categories) ;
6252 if let Some ( RM_SetCommandACLCategories ) = $crate:: raw:: RedisModule_SetCommandACLCategories {
53+ let command =
54+ unsafe { $crate:: raw:: RedisModule_GetCommand . unwrap( ) ( $ctx, name. as_ptr( ) ) } ;
55+ if command. is_null( ) {
56+ $crate:: raw:: redis_log(
57+ $ctx,
58+ & format!( "Error: failed to get command {}" , $command_name) ,
59+ ) ;
60+ return $crate:: raw:: Status :: Err as c_int;
61+ }
6362 let mut optional_failed = true ;
6463 let mut acl_categories = CString :: default ( ) ;
6564 $(
@@ -417,7 +416,9 @@ macro_rules! redis_module {
417416 register_enum_configuration( & context, $enum_configuration_name, $enum_configuration_val, default , $enum_flags_options, $enum_on_changed) ;
418417 ) *
419418 ) ?
420- raw:: RedisModule_LoadConfigs . unwrap( ) ( ctx) ;
419+ if let Some ( load_config) = raw:: RedisModule_LoadConfigs {
420+ load_config( ctx) ;
421+ }
421422
422423 $(
423424 $crate:: redis_command!( ctx, $module_config_get_command, |ctx, args: Vec <RedisString >| {
0 commit comments