File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,7 +169,18 @@ class GitHub extends Base {
169169 if ( ! response . ok ) {
170170 // Retry on 5xx (Server Error) or 403 (Rate Limit/Abuse)
171171 if ( ( response . status >= 500 || response . status === 403 ) && retries > 0 ) {
172- const delay = ( 4 - retries ) * 2000 ; // 2s, 4s, 6s
172+ let delay = ( 4 - retries ) * 2000 ; // Default: 2s, 4s, 6s
173+
174+ // Special handling for 403 Secondary Rate Limit (Abuse Detection)
175+ // If we have quota remaining but get a 403, it's an abuse trigger.
176+ if ( response . status === 403 ) {
177+ const bucket = this . rateLimit . graphql ;
178+ if ( bucket . remaining > 0 ) {
179+ console . warn ( `${ prefix } ⚠️ Abuse Detection triggered (403 with quota). Backing off for 10s...` ) ;
180+ delay = 10000 ; // 10s penalty box
181+ }
182+ }
183+
173184 console . log ( `${ prefix } Error ${ response . status } . Retrying in ${ delay } ms...` ) ;
174185 await new Promise ( r => setTimeout ( r , delay ) ) ;
175186 return this . query ( query , variables , retries - 1 , logContext ) ;
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class Updater extends Base {
5959 let successCount = 0 ;
6060 const saveInterval = config . updater . saveInterval ;
6161 const whitelist = await Storage . getWhitelist ( ) ;
62- const concurrency = 10 ; // Increased to 10 for throughput
62+ const concurrency = 8 ; // Slightly reduced from 10 to balance speed vs stability
6363
6464 // Helper to process a single user
6565 const processUser = async ( login ) => {
You can’t perform that action at this time.
0 commit comments