Skip to content

Commit dc01442

Browse files
CID-3368: Addressing PR comments
1 parent 91aabbc commit dc01442

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/kotlin/net/leanix/githubagent/services/GitHubAPIService.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class GitHubAPIService(
1111
) {
1212

1313
companion object {
14-
private const val PER_PAGE = 30 // Maximum allowed by GitHub API is 100
14+
private const val PAGE_SIZE = 30 // Maximum allowed by GitHub API is 100
1515
}
1616

1717
fun getPaginatedInstallations(jwtToken: String): List<Installation> {
@@ -20,10 +20,10 @@ class GitHubAPIService(
2020
var currentInstallations: List<Installation>
2121

2222
do {
23-
currentInstallations = gitHubClient.getInstallations("Bearer $jwtToken", PER_PAGE, page)
23+
currentInstallations = gitHubClient.getInstallations("Bearer $jwtToken", PAGE_SIZE, page)
2424
if (currentInstallations.isNotEmpty()) installations.addAll(currentInstallations) else break
2525
page++
26-
} while (currentInstallations.size == PER_PAGE)
26+
} while (currentInstallations.size == PAGE_SIZE)
2727
return installations
2828
}
2929

@@ -33,10 +33,10 @@ class GitHubAPIService(
3333
var currentOrganizations: List<Organization>
3434

3535
do {
36-
currentOrganizations = gitHubClient.getOrganizations("Bearer $installationToken", PER_PAGE, since)
36+
currentOrganizations = gitHubClient.getOrganizations("Bearer $installationToken", PAGE_SIZE, since)
3737
if (currentOrganizations.isNotEmpty()) organizations.addAll(currentOrganizations) else break
3838
since = currentOrganizations.last().id
39-
} while (currentOrganizations.size == PER_PAGE)
39+
} while (currentOrganizations.size == PAGE_SIZE)
4040
return organizations
4141
}
4242
}

0 commit comments

Comments
 (0)