From 82e880a86696d9e57c2323bf5fed35a6f0e42efa Mon Sep 17 00:00:00 2001 From: Citrinate Date: Thu, 13 Jun 2024 19:55:36 -0400 Subject: [PATCH] Show actual booster info retry rate in logs --- BoosterManager/Boosters/BoosterQueue.cs | 5 +++-- BoosterManager/Localization/Strings.resx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/BoosterManager/Boosters/BoosterQueue.cs b/BoosterManager/Boosters/BoosterQueue.cs index 2bec78e..9bc2d8c 100644 --- a/BoosterManager/Boosters/BoosterQueue.cs +++ b/BoosterManager/Boosters/BoosterQueue.cs @@ -67,8 +67,9 @@ private async Task Run() { // Reload the booster creator page if (!await UpdateBoosterInfos().ConfigureAwait(false)) { // Reload failed, try again later - Bot.ArchiLogger.LogGenericError(Strings.BoosterInfoUpdateFailed); - UpdateTimer(DateTime.Now.AddMinutes(Math.Min(BoosterInfosUpdateBackOffMaxMinutes, BoosterInfosUpdateBackOffMinMinutes * BoosterInfosUpdateBackOffMultiplier))); + var retryBoosterUpdateInMinutes = Math.Min(BoosterInfosUpdateBackOffMaxMinutes, BoosterInfosUpdateBackOffMinMinutes * BoosterInfosUpdateBackOffMultiplier); + Bot.ArchiLogger.LogGenericError(String.Format(Strings.BoosterInfoUpdateFailed, String.Format("{0:0.##}", retryBoosterUpdateInMinutes))); + UpdateTimer(DateTime.Now.AddMinutes(retryBoosterUpdateInMinutes)); BoosterInfosUpdateBackOffMultiplier += BoosterInfosUpdateBackOffMultiplierStep; return; diff --git a/BoosterManager/Localization/Strings.resx b/BoosterManager/Localization/Strings.resx index 6c2d489..cb0a1b5 100644 --- a/BoosterManager/Localization/Strings.resx +++ b/BoosterManager/Localization/Strings.resx @@ -118,8 +118,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Failed to update booster information, will retry in 1 minute - + Failed to update booster information, will retry in {0} minutes + {0} will be replaced by a number {0} more gems are needed to continue crafting boosters. Crafting will resume when more gems are available.