@@ -188,12 +188,12 @@ export default class RedisCluster<
188188 return async function ( this : ProxyCluster , ...args : Array < unknown > ) {
189189 const parser = new BasicCommandParser ( ) ;
190190 command . parseCommand ( parser , ...args ) ;
191- console . log ( parser , parser . redisArgs [ 0 ] ) ;
192191
193192 return this . _self . _execute (
194193 parser . firstKey ,
195194 command . IS_READ_ONLY ,
196195 this . _commandOptions ,
196+ parser . commandName ! ,
197197 ( client , opts ) => client . _executeCommand ( command , parser , opts , transformReply )
198198 ) ;
199199 } ;
@@ -210,6 +210,7 @@ export default class RedisCluster<
210210 parser . firstKey ,
211211 command . IS_READ_ONLY ,
212212 this . _self . _commandOptions ,
213+ parser . commandName ! ,
213214 ( client , opts ) => client . _executeCommand ( command , parser , opts , transformReply )
214215 ) ;
215216 } ;
@@ -228,6 +229,7 @@ export default class RedisCluster<
228229 parser . firstKey ,
229230 fn . IS_READ_ONLY ,
230231 this . _self . _commandOptions ,
232+ parser . commandName ! ,
231233 ( client , opts ) => client . _executeCommand ( fn , parser , opts , transformReply )
232234 ) ;
233235 } ;
@@ -246,6 +248,7 @@ export default class RedisCluster<
246248 parser . firstKey ,
247249 script . IS_READ_ONLY ,
248250 this . _commandOptions ,
251+ parser . commandName ! ,
249252 ( client , opts ) => client . _executeScript ( script , parser , opts , transformReply )
250253 ) ;
251254 } ;
@@ -459,12 +462,16 @@ export default class RedisCluster<
459462 firstKey : RedisArgument | undefined ,
460463 isReadonly : boolean | undefined ,
461464 options : ClusterCommandOptions | undefined ,
465+ commandName : string ,
462466 fn : ( client : RedisClientType < M , F , S , RESP , TYPE_MAPPING > , opts ?: ClusterCommandOptions ) => Promise < T >
463467 ) : Promise < T > {
464- console . log ( `executing command ` , firstKey , isReadonly , options ) ;
465468 const maxCommandRedirections = this . _options . maxCommandRedirections ?? 16 ;
466- const p = this . _policyResolver . resolvePolicy ( "ping" )
467- console . log ( `ping policy ` , p ) ;
469+ const policyResult = this . _policyResolver . resolvePolicy ( commandName )
470+ if ( policyResult . ok ) {
471+ //TODO
472+ } else {
473+ //TODO
474+ }
468475
469476 let client = await this . _slots . getClient ( firstKey , isReadonly ) ;
470477 let i = 0 ;
@@ -521,6 +528,7 @@ export default class RedisCluster<
521528 firstKey ,
522529 isReadonly ,
523530 options ,
531+ args [ 0 ] instanceof Buffer ? args [ 0 ] . toString ( ) : args [ 0 ] ,
524532 ( client , opts ) => client . sendCommand ( args , opts )
525533 ) ;
526534 }
0 commit comments