Skip to content

Commit

Permalink
Added config option 'logs.github-download-data'
Browse files Browse the repository at this point in the history
  • Loading branch information
Poslovitch committed Jun 9, 2019
1 parent 2340b19 commit 284de9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/main/java/world/bentobox/bentobox/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,20 @@ public class Settings implements ConfigObject {
@ConfigEntry(path = "panel.close-on-click-outside")
private boolean closePanelOnClickOutside = true;

/*
* Logs
*/
@ConfigComment("Toggle whether superflat chunks regeneration should be logged in the server logs or not.")
@ConfigComment("It can be spammy if there are a lot of superflat chunks to regenerate.")
@ConfigComment("However, as superflat chunks regeneration can be performance-intensive, it is recommended to keep")
@ConfigComment("this setting set to true, as it will help you know if there are regenerations taking place.")
@ConfigEntry(path = "logs.clean-super-flat-chunks", since = "1.2.0")
private boolean logCleanSuperFlatChunks = true;

@ConfigComment("Toggle whether downloading data from GitHub should be logged in the server logs or not.")
@ConfigEntry(path = "logs.github-download-data", since = "1.5.0")
private boolean logGithubDownloadData = true;

/*
* Island
*/
Expand Down Expand Up @@ -183,8 +190,7 @@ 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,")
@ConfigComment("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 less than 15 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;
Expand Down Expand Up @@ -483,4 +489,12 @@ public boolean isCheckAddonsUpdates() {
public void setCheckAddonsUpdates(boolean checkAddonsUpdates) {
this.checkAddonsUpdates = checkAddonsUpdates;
}

public boolean isLogGithubDownloadData() {
return logGithubDownloadData;
}

public void setLogGithubDownloadData(boolean logGithubDownloadData) {
this.logGithubDownloadData = logGithubDownloadData;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public void requestGitHubData(boolean clearCache) {
this.gamemodesCatalog.clear();
}

plugin.log("Updating data from GitHub...");
if (plugin.getSettings().isLogGithubDownloadData()) {
plugin.log("Downloading data from GitHub...");
}
try {
String catalogContent = new GitHubGist(gh, "bccabc20bce17f358d0f94bbbe83babd").getRawResponseAsJson()
.getAsJsonObject().getAsJsonObject("files").getAsJsonObject("catalog.json").get("content").getAsString()
Expand Down

0 comments on commit 284de9e

Please sign in to comment.