Skip to content

Commit 726edf2

Browse files
authored
GitHub API increased page size (30 to 1000), reduces load time (30s to 1s) (#1317)
1 parent 844a41a commit 726edf2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

application/src/main/java/org/togetherjava/tjbot/features/github/GitHubCommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
55
import net.dv8tion.jda.api.interactions.commands.OptionType;
66
import org.kohsuke.github.GHIssue;
7-
import org.kohsuke.github.GHIssueState;
87

98
import org.togetherjava.tjbot.features.CommandVisibility;
109
import org.togetherjava.tjbot.features.SlashCommandAdapter;
@@ -124,7 +123,7 @@ private ToIntFunction<String> suggestionScorer(String title) {
124123
private void updateCache() {
125124
autocompleteGHIssueCache = reference.getRepositories().stream().map(repo -> {
126125
try {
127-
return repo.getIssues(GHIssueState.ALL);
126+
return repo.queryIssues().pageSize(1000).list().toList();
128127
} catch (IOException ex) {
129128
throw new UncheckedIOException(ex);
130129
}

0 commit comments

Comments
 (0)