aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2025-03-13 15:37:35 -0400
committerAaron <51387595+AzureAaron@users.noreply.github.com>2025-03-13 15:37:35 -0400
commit0168d294ba746c07a21b15184901ff1d81b8c819 (patch)
treeed8579e40d00ef03ac77d2d53f28d33fd4083f91 /src/main
parentc89e1011fce13f700db0f0bbdafc7b960d30b455 (diff)
downloadSkyblocker-0168d294ba746c07a21b15184901ff1d81b8c819.tar.gz
Skyblocker-0168d294ba746c07a21b15184901ff1d81b8c819.tar.bz2
Skyblocker-0168d294ba746c07a21b15184901ff1d81b8c819.zip
Increase delay for retrying api failures
Prevents clients from spamming requests and stuff.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ApiAuthentication.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/ApiAuthentication.java b/src/main/java/de/hysky/skyblocker/utils/ApiAuthentication.java
index 197a5954..9f39923b 100644
--- a/src/main/java/de/hysky/skyblocker/utils/ApiAuthentication.java
+++ b/src/main/java/de/hysky/skyblocker/utils/ApiAuthentication.java
@@ -97,16 +97,16 @@ public class ApiAuthentication {
Scheduler.INSTANCE.schedule(ApiAuthentication::updateToken, refreshAtTicks, true);
} catch (Exception e) {
- //Try again in 1 minute
- logErrorAndScheduleRetry(Text.translatable("skyblocker.api.token.authFailure"), 60 * 20, "[Skyblocker Api Auth] Failed to refresh the api token! Some features might not work :(", e);
+ //Try again in 15 minutes
+ logErrorAndScheduleRetry(Text.translatable("skyblocker.api.token.authFailure"), 900 * 20, "[Skyblocker Api Auth] Failed to refresh the api token! Some features might not work :(", e);
}
} else {
//The Minecraft Services API is probably down so we will retry in 5 minutes, either that or if your access token has expired (game open for 24h) you will need to restart.
logErrorAndScheduleRetry(Text.translatable("skyblocker.api.token.noProfileKeys"), expired ? -1 : 300 * 20, "[Skyblocker Api Auth] Failed to fetch profile keys! Some features may not work temporarily :( (Has your game been open for more than 24 hours? If so restart.)");
}
}).exceptionally(throwable -> {
- //Try again in 1 minute
- logErrorAndScheduleRetry(Text.translatable("skyblocker.api.token.authFailure"), 60 * 20, "[Skyblocker Api Auth] Encountered an unexpected exception while refreshing the api token!", throwable);
+ //Try again in 5 minutes
+ logErrorAndScheduleRetry(Text.translatable("skyblocker.api.token.authFailure"), 300 * 20, "[Skyblocker Api Auth] Encountered an unexpected exception while refreshing the api token!", throwable);
return null;
});