@@ -188,12 +188,12 @@ export default class RedisCluster<
188
188
return async function ( this : ProxyCluster , ...args : Array < unknown > ) {
189
189
const parser = new BasicCommandParser ( ) ;
190
190
command . parseCommand ( parser , ...args ) ;
191
- console . log ( parser , parser . redisArgs [ 0 ] ) ;
192
191
193
192
return this . _self . _execute (
194
193
parser . firstKey ,
195
194
command . IS_READ_ONLY ,
196
195
this . _commandOptions ,
196
+ parser . commandName ! ,
197
197
( client , opts ) => client . _executeCommand ( command , parser , opts , transformReply )
198
198
) ;
199
199
} ;
@@ -210,6 +210,7 @@ export default class RedisCluster<
210
210
parser . firstKey ,
211
211
command . IS_READ_ONLY ,
212
212
this . _self . _commandOptions ,
213
+ parser . commandName ! ,
213
214
( client , opts ) => client . _executeCommand ( command , parser , opts , transformReply )
214
215
) ;
215
216
} ;
@@ -228,6 +229,7 @@ export default class RedisCluster<
228
229
parser . firstKey ,
229
230
fn . IS_READ_ONLY ,
230
231
this . _self . _commandOptions ,
232
+ parser . commandName ! ,
231
233
( client , opts ) => client . _executeCommand ( fn , parser , opts , transformReply )
232
234
) ;
233
235
} ;
@@ -246,6 +248,7 @@ export default class RedisCluster<
246
248
parser . firstKey ,
247
249
script . IS_READ_ONLY ,
248
250
this . _commandOptions ,
251
+ parser . commandName ! ,
249
252
( client , opts ) => client . _executeScript ( script , parser , opts , transformReply )
250
253
) ;
251
254
} ;
@@ -459,12 +462,16 @@ export default class RedisCluster<
459
462
firstKey : RedisArgument | undefined ,
460
463
isReadonly : boolean | undefined ,
461
464
options : ClusterCommandOptions | undefined ,
465
+ commandName : string ,
462
466
fn : ( client : RedisClientType < M , F , S , RESP , TYPE_MAPPING > , opts ?: ClusterCommandOptions ) => Promise < T >
463
467
) : Promise < T > {
464
- console . log ( `executing command ` , firstKey , isReadonly , options ) ;
465
468
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
+ }
468
475
469
476
let client = await this . _slots . getClient ( firstKey , isReadonly ) ;
470
477
let i = 0 ;
@@ -521,6 +528,7 @@ export default class RedisCluster<
521
528
firstKey ,
522
529
isReadonly ,
523
530
options ,
531
+ args [ 0 ] instanceof Buffer ? args [ 0 ] . toString ( ) : args [ 0 ] ,
524
532
( client , opts ) => client . sendCommand ( args , opts )
525
533
) ;
526
534
}
0 commit comments