From daa5f83cb095044925f7b1f5c02b08cf8d5cc6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= Date: Sun, 22 Sep 2024 16:53:20 -0400 Subject: [PATCH] Reducing MySQL Error Logging When the MYSQL server is down, the loop would go crazy pouring error messages and stack traces into grafana. To the point where the dashboard would stop working. This reduces the spam by giving the server a few seconds to come back up before we try again. --- src/Nullinside.Api.TwitchBot/Services/MainService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Nullinside.Api.TwitchBot/Services/MainService.cs b/src/Nullinside.Api.TwitchBot/Services/MainService.cs index a90b28f..61b1e30 100644 --- a/src/Nullinside.Api.TwitchBot/Services/MainService.cs +++ b/src/Nullinside.Api.TwitchBot/Services/MainService.cs @@ -117,6 +117,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) { } catch (Exception ex) { _log.LogError(ex, "Main Failed"); + await Task.Delay(TimeSpan.FromSeconds(10)); } } }, stoppingToken);