Browse Source

优化进程重启

sunhao 3 years ago
parent
commit
6179f309bb
2 changed files with 1 additions and 9 deletions
  1. 0 4
      live_promotion_detail_v1_sale_scraper.py
  2. 1 5
      live_promotions_scraper.py

+ 0 - 4
live_promotion_detail_v1_sale_scraper.py

145
 
145
 
146
         current_time = time.time()
146
         current_time = time.time()
147
 
147
 
148
-        if current_time - start_time > 1800:
149
-            print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' 主方法执行终止')
150
-            sys.exit(0)
151
-
152
         time.sleep(0.01)
148
         time.sleep(0.01)

+ 1 - 5
live_promotions_scraper.py

21
         request_data_str = rds.get_request_params(heat)
21
         request_data_str = rds.get_request_params(heat)
22
 
22
 
23
         if request_data_str is None:
23
         if request_data_str is None:
24
-            time.sleep(0.1)
24
+            time.sleep(1)
25
             continue
25
             continue
26
 
26
 
27
         rds_list = RdsLivePromotionsRequestList()
27
         rds_list = RdsLivePromotionsRequestList()
103
 
103
 
104
         current_time = time.time()
104
         current_time = time.time()
105
 
105
 
106
-        if current_time - start_time > 1800:
107
-            print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' 主方法执行终止')
108
-            sys.exit(0)
109
-
110
         time.sleep(0.01)
106
         time.sleep(0.01)