Only check for updates each 30 minutes, fixes #6

This commit is contained in:
Frank van der Heijden 2021-01-30 14:52:43 +01:00
parent b46f6fbb1f
commit 51202f1116
No known key found for this signature in database
GPG key ID: 26DA56488D314D11
2 changed files with 15 additions and 17 deletions

View file

@ -83,9 +83,11 @@ public class UpdateCheckerTask implements Runnable {
@Override
public void run() {
plugin.getLogger().info(UPDATE_CHECK_START);
UpdateManager updateManager = plugin.getUpdateManager();
if (!updateManager.canRunUpdateCheck()) return;
updateManager.updateLastUpdateCheck();
plugin.getLogger().info(UPDATE_CHECK_START);
GitHubResponse pluginResponse = getResponse(GITHUB_LINK);
if (pluginResponse == null) return;