浏览代码

优化进程重启

sunhao 3 年之前
父节点
当前提交
6179f309bb
共有 2 个文件被更改,包括 1 次插入9 次删除
  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,8 +145,4 @@ if __name__ == "__main__":
145 145
 
146 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 148
         time.sleep(0.01)

+ 1 - 5
live_promotions_scraper.py

@@ -21,7 +21,7 @@ def scrape(heat):
21 21
         request_data_str = rds.get_request_params(heat)
22 22
 
23 23
         if request_data_str is None:
24
-            time.sleep(0.1)
24
+            time.sleep(1)
25 25
             continue
26 26
 
27 27
         rds_list = RdsLivePromotionsRequestList()
@@ -103,8 +103,4 @@ if __name__ == "__main__":
103 103
 
104 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 106
         time.sleep(0.01)