Skip to content

Commit

Permalink
Ah, need to also set a timeout there :P
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Dec 10, 2024
1 parent 6a65d2c commit 7cc5bdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/co/casterlabs/caffeinated/updater/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.nio.file.Files;
import java.time.Duration;

import co.casterlabs.caffeinated.updater.target.Target;
import co.casterlabs.caffeinated.updater.util.FileUtil;
Expand Down Expand Up @@ -78,7 +79,11 @@ public static int needsUpdate() {

// Check the version.
String installedCommit = buildInfo.getString("commit");
String remoteCommit = WebUtil.sendHttpRequest(HttpRequest.newBuilder().uri(URI.create(CHANNEL_COMMIT_URL))).trim();
String remoteCommit = WebUtil.sendHttpRequest(
HttpRequest.newBuilder()
.uri(URI.create(CHANNEL_COMMIT_URL))
.timeout(Duration.ofSeconds(15))
).trim();
if (!remoteCommit.equals(installedCommit)) return 1;

// Check the channel.
Expand Down

0 comments on commit 7cc5bdb

Please sign in to comment.