14.5
Fixed a small performance bug: If the update check interval was set to 0, it could crash the server and cause spam in the console both to the update check server of T2Code.
This commit is contained in:
parent
b3adbe61e8
commit
623d6f8c12
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>14.4</version>
|
<version>14.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>T2CodeLib</name>
|
<name>T2CodeLib</name>
|
||||||
|
@ -30,6 +30,11 @@ public class T2CupdateCheckerGit {
|
|||||||
}
|
}
|
||||||
String finalRepoURL = RepoURL;
|
String finalRepoURL = RepoURL;
|
||||||
|
|
||||||
|
Integer finalInterval;
|
||||||
|
if (timeInterval < 1){
|
||||||
|
finalInterval = 1;
|
||||||
|
} else finalInterval = timeInterval;
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -65,7 +70,7 @@ public class T2CupdateCheckerGit {
|
|||||||
|
|
||||||
}, plugin.getDescription().getVersion(), spigotID, finalRepoURL, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
|
}, plugin.getDescription().getVersion(), spigotID, finalRepoURL, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
|
||||||
}
|
}
|
||||||
}, 0L, timeInterval * 60 * 20L);
|
}, 0L, finalInterval * 60 * 20L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getVersion(Consumer<T2CupdateWebData> consumer, String pluginVersion, Integer spigotID, String URL, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
|
public void getVersion(Consumer<T2CupdateWebData> consumer, String pluginVersion, Integer spigotID, String URL, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
|
||||||
|
Loading…
Reference in New Issue
Block a user