From 733aca1e22e5b4cecdce37238b9ff43027b2615e Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 04 七月 2022 12:15:43 +0800 Subject: [PATCH] 提交 --- zhengcaioa/Crawler/Program.cs | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zhengcaioa/Crawler/Program.cs b/zhengcaioa/Crawler/Program.cs index aa22779..98b3c75 100644 --- a/zhengcaioa/Crawler/Program.cs +++ b/zhengcaioa/Crawler/Program.cs @@ -13,6 +13,8 @@ { class Program { + public static string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;"; + //public static string connection = @"server=172.26.97.147;database=WebCrawler;uid=sa;pwd=Za20222812;"; static void Main(string[] args) { @@ -142,11 +144,11 @@ { while (true) { - string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;"; var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>(); var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection).Options); //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹� sichuanoperation.operations(cccontext); + //Console.WriteLine("杩欎釜鏆傚仠"); Thread.CurrentThread.Join(1000*60*60*2);//闃绘璁惧畾鏃堕棿 } } @@ -155,8 +157,11 @@ { while (true) { - Console.WriteLine(DateTime.Now.ToString() + "Method2_" + Thread.CurrentThread.ManagedThreadId.ToString()); - Thread.CurrentThread.Join(1000);//闃绘璁惧畾鏃堕棿 + var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>(); + var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection).Options); + //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹� + OldSichuanoperation.operations(cccontext); + Thread.CurrentThread.Join(1000 * 60 * 60 * 2);//闃绘璁惧畾鏃堕棿 } } -- Gitblit v1.9.1