diff options
| author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-03-13 15:37:35 -0400 |
|---|---|---|
| committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-03-13 15:37:35 -0400 |
| commit | 0168d294ba746c07a21b15184901ff1d81b8c819 (patch) | |
| tree | ed8579e40d00ef03ac77d2d53f28d33fd4083f91 /src/main | |
| parent | c89e1011fce13f700db0f0bbdafc7b960d30b455 (diff) | |
| download | Skyblocker-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.java | 8 |
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; }); |
