From 798a80e820c6ccb0c14c4f0475302c8d71528b88 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Mohammadi Date: Tue, 31 Dec 2024 23:31:11 +0330 Subject: [PATCH] Fixed webserver prevention the rest of the program to run --- Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 790bad2..18b5bc6 100755 --- a/Program.cs +++ b/Program.cs @@ -45,7 +45,7 @@ public class MastodonBot }) .Build(); - await host.RunAsync(); + // Setup bot var bot = new TelegramBotClient(config.BOT_TOKEN); @@ -110,6 +110,6 @@ public class MastodonBot new Timer( async _ => await HandleDbBackup.HandleDbBackupAsync(bot, logger, config.DB_NAME, config.ADMIN_NUMID, db), null, TimeSpan.Zero, TimeSpan.FromHours(6)); // Keep the bot running - await Task.Delay(-1); + await host.RunAsync(); } } \ No newline at end of file