File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/contentstack-utilities/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,14 @@ class AuthenticationHandler {
5353
5454 async refreshAccessToken ( error : any , maxRetryCount = 1 ) : Promise < void > {
5555 if ( error . response && error . response . status ) {
56- // Increment the retry count only when not exceeding max retries
5756 if ( maxRetryCount >= 3 ) {
5857 ux . print ( 'Max retry count reached, please login to proceed' , {
5958 color : 'yellow' ,
6059 } ) ;
6160 process . exit ( 1 ) ;
6261 }
6362
64- maxRetryCount ++ ; // Increment here for the next retry attempt
63+ maxRetryCount ++ ; // Increment for the next retry attempt
6564
6665 switch ( error . response . status ) {
6766 case 401 :
@@ -80,8 +79,8 @@ class AuthenticationHandler {
8079
8180 case 429 :
8281 case 408 :
83- // These cases might require a wait, consider adding a delay before retrying
84- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ; // Example wait of 1 second
82+ // These cases require a wait, adding a delay before retrying
83+ await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ; // wait for 1 second
8584 return this . refreshAccessToken ( error , maxRetryCount ) ; // Retry
8685
8786 default :
You can’t perform that action at this time.
0 commit comments