diff --git a/Tools/TestNetRewarder/Program.cs b/Tools/TestNetRewarder/Program.cs index fbf322c..0aaa41c 100644 --- a/Tools/TestNetRewarder/Program.cs +++ b/Tools/TestNetRewarder/Program.cs @@ -1,5 +1,4 @@ using ArgsUniform; -using GethConnector; using Logging; using Utils; @@ -12,6 +11,7 @@ namespace TestNetRewarder public static CancellationToken CancellationToken { get; private set; } public static BotClient BotClient { get; private set; } = null!; private static Processor processor = null!; + private static DateTime lastCheck = DateTime.MinValue; public static Task Main(string[] args) { @@ -65,6 +65,9 @@ namespace TestNetRewarder private static async Task EnsureBotOnline() { var start = DateTime.UtcNow; + var timeSince = start - lastCheck; + if (timeSince.TotalSeconds < 30.0) return; + while (! await BotClient.IsOnline() && !CancellationToken.IsCancellationRequested) { await Task.Delay(5000); @@ -77,6 +80,8 @@ namespace TestNetRewarder throw new Exception(msg); } } + + lastCheck = start; } private static void PrintHelp()