File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export function createQueueKeysFC(schemaComposer: SchemaComposer<any>) {
99 fields : {
1010 queueName : 'String!' ,
1111 prefix : 'String!' ,
12+ prefixMaskNorm : 'String' ,
1213 } ,
1314 } )
1415 . getTypePlural ( ) ,
@@ -23,25 +24,22 @@ export function createQueueKeysFC(schemaComposer: SchemaComposer<any>) {
2324
2425 let prefixMaskNorm = prefixMask ;
2526 const nameCase = prefixMaskNorm . split ( ':' ) . length - 1 ;
26- if ( nameCase === 2 ) {
27- prefixMaskNorm = prefixMaskNorm . endsWith ( '*' )
28- ? prefixMaskNorm . substr ( 0 , prefixMaskNorm . length - 1 )
29- : prefixMaskNorm ;
27+ if ( nameCase >= 2 ) {
28+ prefixMaskNorm = prefixMaskNorm . split ( ':' ) . slice ( 0 , 2 ) . join ( ':' ) + ':' ;
3029 } else if ( nameCase === 1 ) {
3130 prefixMaskNorm += ':' ;
3231 } else {
3332 prefixMaskNorm += prefixMaskNorm . endsWith ( '*' ) ? ':*:' : '*:*:' ;
3433 }
3534
36- prefixMaskNorm += 'meta' ;
37-
38- const keys = await connection . keys ( prefixMaskNorm ) ;
35+ const keys = await connection . keys ( prefixMaskNorm + 'meta' ) ;
3936
4037 return keys . map ( ( key ) => {
4138 const parts = key . split ( ':' ) ;
4239 return {
4340 queueName : parts [ 0 ] ,
4441 prefix : parts [ 1 ] ,
42+ prefixMaskNorm,
4543 } ;
4644 } ) ;
4745 } ,
You can’t perform that action at this time.
0 commit comments