Fixed webserver prevention the rest of the program to run

This commit is contained in:
2024-12-31 23:31:11 +03:30
parent d02d5744ff
commit 798a80e820

View File

@@ -45,7 +45,7 @@ public class MastodonBot
}) })
.Build(); .Build();
await host.RunAsync();
// Setup bot // Setup bot
var bot = new TelegramBotClient(config.BOT_TOKEN); var bot = new TelegramBotClient(config.BOT_TOKEN);
@@ -110,6 +110,6 @@ public class MastodonBot
new Timer( new Timer(
async _ => await HandleDbBackup.HandleDbBackupAsync(bot, logger, config.DB_NAME, config.ADMIN_NUMID, db), null, TimeSpan.Zero, TimeSpan.FromHours(6)); async _ => await HandleDbBackup.HandleDbBackupAsync(bot, logger, config.DB_NAME, config.ADMIN_NUMID, db), null, TimeSpan.Zero, TimeSpan.FromHours(6));
// Keep the bot running // Keep the bot running
await Task.Delay(-1); await host.RunAsync();
} }
} }