Skip to content

Commit

Permalink
fix(v4): rate limit is null when GHE has no rate limit settings
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Oct 6, 2020
1 parent 6116c67 commit 5ca0405
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Renderer/Library/GitHub/V4/GitHubV4Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export class GitHubV4Client {
}

private async waitRateLimit(data: RemoteGitHubV4Entity) {
// GHEの場合、rateLimitが設定されていない場合がある
if (!data.rateLimit) return;
if (data.rateLimit.remaining > 0) return;

const resetAtMillSec = new Date(data.rateLimit.resetAt).getTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export type RemoteGitHubV4Entity = {
limit: number;
remaining: number;
resetAt: string; // YYYY-MM-DDThh:mm:ssZ
}
} | null
}

0 comments on commit 5ca0405

Please sign in to comment.