Skip to content

Commit 817ffe0

Browse files
committed
Update update checking logic to pause due to API cost concerns; remove outdated code and improve initialization process
1 parent 467f737 commit 817ffe0

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

src/main/java/io/nodelink/server/update/Updater.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,23 @@ public class Updater {
2424
public void checkForUpdates() {
2525
try {
2626
NodeLink.getInstance().getLogger().INFO("\u001B[94m[NodeLink] \u001B[0mChecking for updates...");
27+
NodeLink.getInstance().getLogger().INFO("\u001B[94m[NodeLink] \u001B[0mEn rainson de coût financier lié aux requêtes API GitHub, la vérification des mises à jour sont interrrompues jusqu'à nouvel ordre.");
2728

28-
Thread.sleep(1000);
29-
30-
Class<?> classReference = Updater.class;
31-
32-
URL url = classReference.getProtectionDomain().getCodeSource().getLocation();
29+
Thread.sleep(2000);
3330

34-
Path filePath = Paths.get(url.toURI());
35-
Path FolderParent = filePath.getParent();
31+
NodeLink.getHelper().INITIALIZE();
3632

37-
if (isLatestVersion()) {
38-
downloadFile("https://raw.githubusercontent.com/NodeLink-Project/nodelink-project.github.io/main/nodelink-server/jar/io/nodelink/server/NodeLink-Server/" + fetchVersion() + "/NodeLink-Server-" + fetchVersion() + "-fat.jar", FolderParent.toString() + "/NodeLink-Server-" + fetchVersion() + ".jar");
39-
removeAndStartNewVersion();
40-
}
33+
// Class<?> classReference = Updater.class;
34+
//
35+
// URL url = classReference.getProtectionDomain().getCodeSource().getLocation();
36+
//
37+
// Path filePath = Paths.get(url.toURI());
38+
// Path FolderParent = filePath.getParent();
39+
//
40+
// if (isLatestVersion()) {
41+
// downloadFile("https://raw.githubusercontent.com/NodeLink-Project/nodelink-project.github.io/main/nodelink-server/jar/io/nodelink/server/NodeLink-Server/" + fetchVersion() + "/NodeLink-Server-" + fetchVersion() + "-fat.jar", FolderParent.toString() + "/NodeLink-Server-" + fetchVersion() + ".jar");
42+
// removeAndStartNewVersion();
43+
// }
4144

4245
} catch (Exception exception) {
4346
NodeLink.getInstance().getLogger().ERROR(exception.getMessage());
@@ -47,7 +50,7 @@ public void checkForUpdates() {
4750
private String fetchVersion() {
4851
try {
4952
final String API_URL = "https://api.github.com/repos/NodeLink-Project/NodeLink-Server/tags";
50-
final String TOKEN = "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";
53+
final String TOKEN = "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";
5154

5255
final String authorizationHeader = "Bearer " + TOKEN;
5356
Thread.sleep(1000);

0 commit comments

Comments
 (0)