Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Nov 28, 2024
1 parent 27db796 commit a1e16eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,20 +1036,17 @@ class Bmw extends utils.Adapter {
url: url,
headers: headers,
'axios-retry': {
retries: 3,
retries: 5,
// only 403 rate limit
retryCondition: (error) => {
this.log.debug(error);
error.response && this.log.debug(JSON.stringify(error.response.data));
return error.response && error.response.status === 403;
},
retryDelay: () => {
return 5000;
},
onRetry: (retryCount, error) => {
this.log.debug('Retry ' + retryCount);
this.log.info('Retry ' + retryCount);
this.log.debug(error);
error.response && this.log.debug(JSON.stringify(error.response.data));
error.response && this.log.info(JSON.stringify(error.response.data));
this.log.warn('Rate Limit exceeded, retry in 5 seconds');
},
onMaxRetryTimesExceeded: () => {
Expand Down Expand Up @@ -1144,6 +1141,9 @@ class Bmw extends utils.Adapter {
this.log.error(error);
if (error.response) {
this.log.error(JSON.stringify(error.response.data));
if (error.response.status === 403) {
return 'Rate Limit exceeded';
}
}
return 'Failed';
}
Expand Down

0 comments on commit a1e16eb

Please sign in to comment.