File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class UndiscordCore {
3232 pattern : null , // Only delete messages that match the regex (insensitive)
3333 searchDelay : null , // Delay each time we fetch for more messages
3434 deleteDelay : null , // Delay between each delete operation
35+ jobDelay : 30000 , // Delay between each job during batches
3536 maxAttempt : 2 , // Attempts to delete a single message if it fails
3637 askForConfirmation : true ,
3738 } ;
@@ -86,6 +87,11 @@ class UndiscordCore {
8687
8788 log . info ( `Runnning batch with queue of ${ queue . length } jobs` ) ;
8889 for ( let i = 0 ; i < queue . length ; i ++ ) {
90+ if ( i > 0 ) {
91+ log . verb ( `Waiting ${ ( this . options . jobDelay / 1000 ) . toFixed ( 2 ) } s before next job...` ) ;
92+ await wait ( this . options . jobDelay ) ;
93+ }
94+
8995 const job = queue [ i ] ;
9096 log . info ( 'Starting job...' , `(${ i + 1 } /${ queue . length } )` ) ;
9197
You can’t perform that action at this time.
0 commit comments