static void Main(string[] args) { var config = new SentConfig(LogManager.GetCurrentClassLogger()); var bot = new TelegramBot(); var parser = new NewsParser(bot, config); while (true) { try { parser.Parse(); } catch (Exception e) { Console.WriteLine(e); } Thread.Sleep(TimeSpan.FromSeconds(60)); } }
static async Task Main(string[] args) { var config = new SentConfig(LogManager.GetCurrentClassLogger()); var bot = new TelegramBot(); var parser = new NewsParser(bot, config); while (true) { try { await parser.Parse(); } catch (Exception e) { Console.WriteLine(e); } await Task.Delay(TimeSpan.FromSeconds(60)); } }