Skip to content

Commit

Permalink
Avoid pagination when not required
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Jun 22, 2024
1 parent 8318caf commit 195ebd3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.jsonwebtoken.lang.Arrays;
import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.function.InputStreamFunction;
import org.kohsuke.github.internal.EnumUtils;
Expand Down Expand Up @@ -3627,11 +3628,10 @@ public void unstar() throws IOException {
* the io exception
*/
public List<GHRepositoryTrafficTopReferralPath> getTopReferralPaths() throws IOException {
return root().createRequest()
return Arrays.asList(root().createRequest()
.method("GET")
.withUrlPath("/repos/%s/%s/traffic/popular/paths", getOwnerName(), name)
.toIterable(GHRepositoryTrafficTopReferralPath[].class, null)
.toList();
.fetch(GHRepositoryTrafficTopReferralPath[].class));
}

/**
Expand All @@ -3643,11 +3643,10 @@ public List<GHRepositoryTrafficTopReferralPath> getTopReferralPaths() throws IOE
* the io exception
*/
public List<GHRepositoryTrafficTopReferralSources> getTopReferralSources() throws IOException {
return root().createRequest()
return Arrays.asList(root().createRequest()
.method("GET")
.withUrlPath("/repos/%s/%s/traffic/popular/referrers", getOwnerName(), name)
.toIterable(GHRepositoryTrafficTopReferralSources[].class, null)
.toList();
.fetch(GHRepositoryTrafficTopReferralSources[].class));
}

/**
Expand Down

0 comments on commit 195ebd3

Please sign in to comment.