From 47ded178e8066158f8737dd68b54aeb3d7f24339 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 04 七月 2022 12:13:43 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/Crawler/Program.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/zhengcaioa/Crawler/Program.cs b/zhengcaioa/Crawler/Program.cs
index aa22779..8c24ce4 100644
--- a/zhengcaioa/Crawler/Program.cs
+++ b/zhengcaioa/Crawler/Program.cs
@@ -13,6 +13,7 @@
 {
     class Program
     {
+        public static string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;";
         static void Main(string[] args)
         {
            
@@ -142,11 +143,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 +156,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