Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add more useful logging when github crawler ratelimit is reached #381

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions oss-api/src/github-crawler/github-crawler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -394,6 +397,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -454,6 +460,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
return;
}
this.logger.error(error);
Expand Down Expand Up @@ -518,6 +527,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -581,6 +593,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -646,6 +661,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -709,6 +727,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -768,6 +789,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -835,6 +859,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -885,6 +912,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -939,6 +969,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down Expand Up @@ -1000,6 +1033,9 @@ export class GithubCrawlerService {
parseInt(error.response.headers['x-ratelimit-limit'])
) {
this.reachedGithubCallLimit = true;
console.log(
'Ratelimit is reached. ause Crawling until Github-Api allows new calls (at xx.00)',
);
}
this.logger.error(error);
this.telemetryService.incrementErrorStatus();
Expand Down
Loading