From bd320331697cda733d63dbd2b5d00e3e9ba7468a Mon Sep 17 00:00:00 2001 From: Alathreon Date: Sun, 31 Aug 2025 00:43:04 +0200 Subject: [PATCH] Feature/ReduceLoadTime reduced the time of loading issues from 30s to 1s --- .../org/togetherjava/tjbot/features/github/GitHubCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/features/github/GitHubCommand.java b/application/src/main/java/org/togetherjava/tjbot/features/github/GitHubCommand.java index 53a7eed187..33f9844656 100644 --- a/application/src/main/java/org/togetherjava/tjbot/features/github/GitHubCommand.java +++ b/application/src/main/java/org/togetherjava/tjbot/features/github/GitHubCommand.java @@ -4,7 +4,6 @@ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; import net.dv8tion.jda.api.interactions.commands.OptionType; import org.kohsuke.github.GHIssue; -import org.kohsuke.github.GHIssueState; import org.togetherjava.tjbot.features.CommandVisibility; import org.togetherjava.tjbot.features.SlashCommandAdapter; @@ -124,7 +123,7 @@ private ToIntFunction suggestionScorer(String title) { private void updateCache() { autocompleteGHIssueCache = reference.getRepositories().stream().map(repo -> { try { - return repo.getIssues(GHIssueState.ALL); + return repo.queryIssues().pageSize(1000).list().toList(); } catch (IOException ex) { throw new UncheckedIOException(ex); }