File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,22 @@ export async function deleteQueue(
2222
2323 const total = await new Promise < number > ( ( resolve , reject ) => {
2424 //redis-cli: scan 0 match fullName* count 300
25- const stream = connection . scanStream ( { match : fullName + '*' , count : 300 } ) ;
25+ const stream = connection . scanStream ( { match : fullName + '*' , count : 1000 } ) ;
2626
2727 let total = 0 ;
2828
29+ let pipeline = connection . pipeline ( ) ;
30+
2931 stream . on ( 'data' , async ( keys ) => {
3032 for ( let i = 0 ; i < keys . length ; i ++ ) {
31- const del = await connection . del ( keys [ i ] ) ;
33+ const del = pipeline . del ( keys [ i ] ) ;
3234 if ( del ) {
3335 total ++ ;
3436 }
3537 }
38+
39+ await pipeline . exec ( ) ;
40+ pipeline = connection . pipeline ( ) ;
3641 } ) ;
3742
3843 stream . on ( 'end' , ( ) => {
You can’t perform that action at this time.
0 commit comments