Increased the minimum time between connections to the GH API to 60 minutes

This commit is contained in:
Florian CUNY 2019-06-30 08:56:38 +02:00
parent 64d89f9ca9
commit 563465ad14
2 changed files with 4 additions and 4 deletions

View File

@ -191,10 +191,10 @@ public class Settings implements ConfigObject {
@ConfigComment("Time in minutes between each connection to the GitHub API.")
@ConfigComment("This allows for up-to-the-minute information gathering.")
@ConfigComment("However, as the GitHub API data does not get updated instantly, this value cannot be set less than 15 minutes.")
@ConfigComment("However, as the GitHub API data does not get updated instantly, this value cannot be set to less than 60 minutes.")
@ConfigComment("Setting this to 0 will make BentoBox download data only at startup.")
@ConfigEntry(path = "web.github.connection-interval", since = "1.5.0")
private int githubConnectionInterval = 60;
private int githubConnectionInterval = 120;
@ConfigEntry(path = "web.updater.check-updates.bentobox", since = "1.3.0", hidden = true)
private boolean checkBentoBoxUpdates = true;

View File

@ -44,8 +44,8 @@ public class WebManager {
// If below 0, it means we shouldn't run this as a repeating task.
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, () -> requestGitHubData(true), 20L);
} else {
// Set connection interval to be at least 15 minutes.
connectionInterval = Math.max(connectionInterval, 15 * 20 * 60L);
// Set connection interval to be at least 60 minutes.
connectionInterval = Math.max(connectionInterval, 60 * 20 * 60L);
plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, () -> requestGitHubData(true), 20L, connectionInterval);
}
}